Single-precision floating-point format: Difference between revisions

Content deleted Content added
m Reverted edit by 2001:5B0:4ADD:F598:86C:90F1:F39D:7A3C (talk) to last version by Johnuniq
No edit summary
Tags: Reverted Mobile edit Mobile web edit
Line 6:
A floating-point variable can represent a wider range of numbers than a [[fixed-point arithmetic|fixed-point]] variable of the same bit width at the cost of precision. A [[signedness|signed]] 32-bit [[integer]] variable has a maximum value of 2<sup>31</sup> − 1 = 2,147,483,647, whereas an [[IEEE 754]] 32-bit base-2 floating-point variable has a maximum value of (2 − 2<sup>−23</sup>) × 2<sup>127</sup> ≈ 3.4028235 × 10<sup>38</sup>. All integers with seven or fewer decimal digits, and any 2<sup>''n''</sup> for a whole number −149 ≤ ''n'' ≤ 127, can be converted exactly into an IEEE 754 single-precision floating-point value.
 
In the IEEE 754 [[standardization|standard]], the 32-bit base-2 format is officially referred to as '''binary32'''; it was called '''single''' in [[IEEE 754-1985]]. IEEE 754 specifies additional floating-pointp22422wgv03
oint types, such as 64-bit base-2 ''[[double-precision floating-point format|double precision]]'' and, more recently, base-10 representations.
 
One of the first [[programming language]]s to provide single- and double-precision floating-point data types was [[Fortran]]. Before the widespread adoption of IEEE 754-1985, the representation and properties of floating-point data types depended on the [[computer manufacturer]] and computer model, and upon decisions made by programming-language designers. E.g., [[GW-BASIC]]'s single-precision data type was the [[32-bit MBF]] floating-point format.