Home >Backend Development >C#.Net Tutorial >What does 21f mean in C language?
"21f" in C language represents a single-precision floating point number with a value of 21.0, which represents a floating point number: Mantissa: 21 Base: 10 Exponent: 0 Binary representation: 0000000001111111100000000000000000000000000000000000000 Floating point value: 1.0 × 2 ^ 127 = 21.0
The meaning of 21f in C language
In C language, "21f" is a floating point constant, Represents a single-precision floating point number with value 21.0. It is expressed using scientific notation, where:
In C language, single-precision floating-point numbers are stored in 32 bits and represent a range from -3.4e38 to 3.4e38. Therefore, "21f" represents a real number between -3.4e38 and 3.4e38.
Floating point number representation
Floating point numbers are represented using scientific notation, as follows:
<code>± 尾数 × 基数 ^ 指数</code>
Where:
Format of single-precision floating-point numbers
Single-precision floating-point numbers in C language are stored in the following format:
<code>符号位 (1 位) | 指数位 (8 位) | 尾数位 (23 位)</code>
Where:
The binary representation of "21f" is:
<code>00000000 | 01111111 | 10000000000000000000000</code>
Among them:
Therefore, the floating point value of "21f" is:
<code>1.0 × 2 ^ 127 = 21.0</code>
The above is the detailed content of What does 21f mean in C language?. For more information, please follow other related articles on the PHP Chinese website!