Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Calculate the data range that can be represented by four data types in C language: int, float, double and char.
Calculate the data range that can be represented by four data types in C language: int, float, double and char.
Int is a signed integer, and its value range varies according to different systems (compilers). For DOS system, 16 bits: -(2 15) to (2 15- 1), for 32-bit system: -(2 365438). If it is an unsigned int, then 16bits system (DOS system): 0 to (2 16- 1), 32 bits: 0 to (2 32- 1), and 64 bits: 0 to (2 64

Float and double are floating-point and double-precision respectively, representing decimals with different precision.

Float is a single-precision floating-point type, which can be accurate to six decimal places, 3.4x10 (-38) ~ 3.4x10 (+38).

Double is a double-precision floating-point type, which can be accurate to 12 decimal places,1.7x10 (-308) ~1.7x10 (+308).

Char is a single-byte character, from-(2 7) to 2 7-1,that is,-128 to 127. For unsigned characters, it is 0 to 2 8-1,that is, 0 to 255.

Hope to adopt