Singleprecision floatingpoint format (sometimes called FP32 or float32) is a computer number format, usually occupying 32 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point.
A floatingpoint variable can represent a wider range of numbers than a fixedpoint variable of the same bit width at the cost of precision. A signed 32bit integer variable has a maximum value of 2^{31} − 1 = 2,147,483,647, whereas an IEEE 754 32bit base2 floatingpoint variable has a maximum value of (2 − 2^{−23}) × 2^{127} ≈ 3.4028235 × 10^{38}. All integers with 7 or fewer decimal digits, and any 2^{n} for a whole number −149 ≤ n ≤ 127, can be converted exactly into an IEEE 754 singleprecision floatingpoint value.
In the IEEE 754 standard, the 32bit base2 format is officially referred to as binary32; it was called single in IEEE 7541985. IEEE 754 specifies additional floatingpoint types, such as 64bit base2 double precision and, more recently, base10 representations.
One of the first programming languages to provide single and doubleprecision floatingpoint data types was Fortran. Before the widespread adoption of IEEE 7541985, the representation and properties of floatingpoint data types depended on the computer manufacturer and computer model, and upon decisions made by programminglanguage designers. E.g., GWBASIC's singleprecision data type was the 32bit MBF floatingpoint format.
Single precision is termed REAL in Fortran;^{[1]} SINGLEFLOAT in Common Lisp;^{[2]} float in C, C++, C# and Java;^{[3]} Float in Haskell^{[4]} and Swift;^{[5]} and Single in Object Pascal (Delphi), Visual Basic, and MATLAB. However, float in Python, Ruby, PHP, and OCaml and single in versions of Octave before 3.2 refer to doubleprecision numbers. In most implementations of PostScript, and some embedded systems, the only supported precision is single.
Floatingpoint formats 

IEEE 754 

Other 
Alternatives 
The IEEE 754 standard specifies a binary32 as having:
This gives from 6 to 9 significant decimal digits precision. If a decimal string with at most 6 significant digits is converted to the IEEE 754 singleprecision format, giving a normal number, and then converted back to a decimal string with the same number of digits, the final result should match the original string. If an IEEE 754 singleprecision number is converted to a decimal string with at least 9 significant digits, and then converted back to singleprecision representation, the final result must match the original number.^{[6]}
The sign bit determines the sign of the number, which is the sign of the significand as well. The exponent field is an 8bit unsigned integer from 0 to 255, in biased form: a value of 127 represents the actual exponent zero. Exponents range from −126 to +127 (thus 1 to 254 in the exponent field), because the biased exponent values 0 (all 0s) and 255 (all 1s) are reserved for special numbers (subnormal numbers, signed zeros, infinities, and NaNs).
The true significand of normal numbers includes 23 fraction bits to the right of the binary point and an implicit leading bit (to the left of the binary point) with value 1. Subnormal numbers and zeros (which are the floatingpoint numbers smaller in magnitude than the least positive normal number) are represented with the biased exponent value 0, giving the implicit leading bit the value 0. Thus only 23 fraction bits of the significand appear in the memory format, but the total precision is 24 bits (equivalent to log_{10}(2^{24}) ≈ 7.225 decimal digits).
The bits are laid out as follows:
The real value assumed by a given 32bit binary32 data with a given sign, biased exponent e (the 8bit unsigned integer), and a 23bit fraction is
which yields
In this example:
thus:
Note:
The singleprecision binary floatingpoint exponent is encoded using an offsetbinary representation, with the zero offset being 127; also known as exponent bias in the IEEE 754 standard.
Thus, in order to get the true exponent as defined by the offsetbinary representation, the offset of 127 has to be subtracted from the stored exponent.
The stored exponents 00_{H} and FF_{H} are interpreted specially.
Exponent  fraction = 0  fraction ≠ 0  Equation 

00_{H} = 00000000_{2}  ±zero  subnormal number  
01_{H}, ..., FE_{H} = 00000001_{2}, ..., 11111110_{2}  normal value  
FF_{H} = 11111111_{2}  ±infinity  NaN (quiet, signalling) 
The minimum positive normal value is and the minimum positive (subnormal) value is .
In general, refer to the IEEE 754 standard itself for the strict conversion (including the rounding behaviour) of a real number into its equivalent binary32 format.
Here we can show how to convert a base10 real number into an IEEE 754 binary32 format using the following outline:
Conversion of the fractional part: Consider 0.375, the fractional part of 12.375. To convert it into a binary fraction, multiply the fraction by 2, take the integer part and repeat with the new fraction by 2 until a fraction of zero is found or until the precision limit is reached which is 23 fraction digits for IEEE 754 binary32 format.
We see that can be exactly represented in binary as . Not all decimal fractions can be represented in a finite digit binary fraction. For example, decimal 0.1 cannot be represented in binary exactly, only approximated. Therefore:
Since IEEE 754 binary32 format requires real values to be represented in format (see Normalized number, Denormalized number), 1100.011 is shifted to the right by 3 digits to become
Finally we can see that:
From which we deduce:
From these we can form the resulting 32bit IEEE 754 binary32 format representation of 12.375:
Note: consider converting 68.123 into IEEE 754 binary32 format: Using the above procedure you expect to get with the last 4 bits being 1001. However, due to the default rounding behaviour of IEEE 754 format, what you get is , whose last 4 bits are 1010.
Example 1: Consider decimal 1. We can see that:
From which we deduce:
From these we can form the resulting 32bit IEEE 754 binary32 format representation of real number 1:
Example 2: Consider a value 0.25. We can see that:
From which we deduce:
From these we can form the resulting 32bit IEEE 754 binary32 format representation of real number 0.25:
Example 3: Consider a value of 0.375. We saw that
Hence after determining a representation of 0.375 as we can proceed as above:
From these we can form the resulting 32bit IEEE 754 binary32 format representation of real number 0.375:
If the binary32 value, 41C80000 in this example, is in hexadecimal we first convert it to binary:
then we break it down into three parts: sign bit, exponent, and significand.
We then add the implicit 24th bit to the significand:
and decode the exponent value by subtracting 127:
Each of the 24 bits of the significand (including the implicit 24th bit), bit 23 to bit 0, represents a value, starting at 1 and halves for each bit, as follows:
bit 23 = 1 bit 22 = 0.5 bit 21 = 0.25 bit 20 = 0.125 bit 19 = 0.0625 bit 18 = 0.03125 bit 17 = 0.015625 . . bit 6 = 0.00000762939453125 bit 5 = 0.000003814697265625 bit 4 = 0.0000019073486328125 bit 3 = 0.00000095367431640625 bit 2 = 0.000000476837158203125 bit 1 = 0.0000002384185791015625 bit 0 = 0.00000011920928955078125
The significand in this example has three bits set: bit 23, bit 22, and bit 19. We can now decode the significand by adding the values represented by these bits.
Then we need to multiply with the base, 2, to the power of the exponent, to get the final result:
Thus
This is equivalent to:
where s is the sign bit, x is the exponent, and m is the significand.
These examples are given in bit representation, in hexadecimal and binary, of the floatingpoint value. This includes the sign, (biased) exponent, and significand.
0 00000000 00000000000000000000001_{2} = 0000 0001_{16} = 2^{−126} × 2^{−23} = 2^{−149} ≈ 1.4012984643 × 10^{−45} (smallest positive subnormal number)
0 00000000 11111111111111111111111_{2} = 007f ffff_{16} = 2^{−126} × (1 − 2^{−23}) ≈ 1.1754942107 ×10^{−38} (largest subnormal number)
0 00000001 00000000000000000000000_{2} = 0080 0000_{16} = 2^{−126} ≈ 1.1754943508 × 10^{−38} (smallest positive normal number)
0 11111110 11111111111111111111111_{2} = 7f7f ffff_{16} = 2^{127} × (2 − 2^{−23}) ≈ 3.4028234664 × 10^{38} (largest normal number)
0 01111110 11111111111111111111111_{2} = 3f7f ffff_{16} = 1 − 2^{−24} ≈ 0.999999940395355225 (largest number less than one)
0 01111111 00000000000000000000000_{2} = 3f80 0000_{16} = 1 (one)
0 01111111 00000000000000000000001_{2} = 3f80 0001_{16} = 1 + 2^{−23} ≈ 1.00000011920928955 (smallest number larger than one)
1 10000000 00000000000000000000000_{2} = c000 0000_{16} = −2 0 00000000 00000000000000000000000_{2} = 0000 0000_{16} = 0 1 00000000 00000000000000000000000_{2} = 8000 0000_{16} = −0 0 11111111 00000000000000000000000_{2} = 7f80 0000_{16} = infinity 1 11111111 00000000000000000000000_{2} = ff80 0000_{16} = −infinity 0 10000000 10010010000111111011011_{2} = 4049 0fdb_{16} ≈ 3.14159274101257324 ≈ π ( pi ) 0 01111101 01010101010101010101011_{2} = 3eaa aaab_{16} ≈ 0.333333343267440796 ≈ 1/3 x 11111111 10000000000000000000001_{2} = ffc0 0001_{16} = qNaN (on x86 and ARM processors) x 11111111 00000000000000000000001_{2} = ff80 0001_{16} = sNaN (on x86 and ARM processors)
By default, 1/3 rounds up, instead of down like double precision, because of the even number of bits in the significand. The bits of 1/3 beyond the rounding point are 1010...
which is more than 1/2 of a unit in the last place.
Encodings of qNaN and sNaN are not specified in IEEE 754 and implemented differently on different processors. The x86 family and the ARM family processors use the most significant bit of the significand field to indicate a quiet NaN. The PARISC processors use the bit to indicate a signalling NaN.
The design of floatingpoint format allows various optimisations, resulting from the easy generation of a base2 logarithm approximation from an integer view of the raw bit pattern. Integer arithmetic and bitshifting can yield an approximation to reciprocal square root (fast inverse square root), commonly required in computer graphics.