Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - When to use int, float, double, unsigned.long and the like in C++? <10 points> Put it simply and it should be easy to understand.
When to use int, float, double, unsigned.long and the like in C++? <10 points> Put it simply and it should be easy to understand.

int is an integer, which is an integer, and is signed

float is a single-precision floating-point number, which is also a decimal number

double is a double-precision floating-point number, which is also a decimal number. However, the range is much larger than float (used when high precision is required)

unsigned long has the same meaning as unsigned int under the current 64-bit machine. Unsigned long integer (the original intention is that the range is larger than int, but due to 64 The characteristics of bit machines make no difference between long and int)

Hope this is helpful to you

@@Unsigned means a positive number (no negative sign)

With a sign, it can be positive or negative