Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Integer variables int are defined, and the system allocates 2 bytes of storage space to each of them. Its numerical range is: -32768 ~ 32767. How is the scope obtained?
Integer variables int are defined, and the system allocates 2 bytes of storage space to each of them. Its numerical range is: -32768 ~ 32767. How is the scope obtained?
Range: one byte is an 8-bit binary number, and the long integer variable system allocates 4 bytes, that is, 4×8-bit binary numbers are allocated, and the numerical range is: 3 1 to the -2 power. The others are similar.

Valid figures:

Floating-point number 7 significant digits.

Double precision number 16 significant digits.

The representation of floating-point numbers in C/C++ follows the IEEE 754 standard.

Floating-point number consists of three parts: sign bit S, exponent part E (sequence code) and mantissa part M (as follows).

floating

S - E - M

1 bit -8 -23

double;twofold

S - E - M

1 bit-1 1 bit -52

The conversion formula of decimal number is (n m represents the m power of n, and b represents the previous binary number):

2^(E- 127) * ( 1。 M)B

The precision of floating-point numbers depends on the mantissa part. The more digits in the mantissa part, the more significant digits can be represented.

The mantissa of a single-precision number is stored as 23 bits, plus the default 1 bit 1 2 (23+1) =16777216 before the decimal point. Because 10 7

The mantissa with double precision is stored in 52 bits, 2 (52+1) = 90071992 54740992,10/6.