Quadruple-precision floating-point format: Difference between revisions

Content deleted Content added
Formatting tweaks mistakenly undone
Quadruple precision examples: fix monospace formatting without using the space trick
Line 50:
=== Quadruple precision examples ===
These examples are given in bit ''representation'', in [[hexadecimal]], of the floating-point value. This includes the sign, (biased) exponent, and significand.
{| style="font-family: monospace, monospace;"
|
0000 0000 0000 0000 0000 0000 0000 0001<sub>16</sub> = 2<sup>−16382</sup> × 2<sup>−112</sup> = 2<sup>−16494</sup><br>
{{spaces|42}}≈ 6.4751751194380251109244389582276465525 × 10<sup>−4966</sup><br>
{{spaces|42}}(smallest positive subnormal number)
 
0000 0000ffff 0000ffff 0000ffff 0000ffff 0000ffff 0000ffff 0001ffff<sub>16</sub> = 2<sup>−16382</sup> × (1 − 2<sup>−112</sup> = 2)<sup>−16494</supbr>
{{spaces|42}}≈ 3.3621031431120935062626778173217519551 × 10<sup>−4932</sup><br>
≈ 6.4751751194380251109244389582276465525 × 10<sup>−4966</sup>
{{spaces|42}}(smallest positivelargest subnormal number)
 
0001 0000 ffff0000 ffff0000 ffff0000 ffff0000 ffff0000 ffff ffff0000<sub>16</sub> = 2<sup>−16382</sup> × (1 − 2<sup>−112</supbr>)
{{spaces|42}}≈ 3.36210314311209350626267781732175195513621031431120935062626778173217526026 × 10<sup>−4932</sup><br>
{{spaces|42}}(smallest positive normal number)
(largest subnormal number)
 
00017ffe 0000ffff 0000ffff 0000ffff 0000ffff 0000ffff 0000ffff 0000ffff<sub>16</sub> = 2<sup>−1638216383</sup> × (2 − 2<sup>−112</sup>)<br>
{{spaces|42}}≈ 1.1897314953572317650857593266280070162 × 10<sup>4932</sup><br>
≈ 3.3621031431120935062626778173217526026 × 10<sup>−4932</sup>
{{spaces|42}}(smallest positivelargest normal number)
 
7ffe3ffe ffff ffff ffff ffff ffff ffff ffff<sub>16</sub> = 2<sup>16383</sup> × (21 − 2<sup>−112−113</sup>)<br>
{{spaces|42}}≈ 0.9999999999999999999999999999999999037<br>
≈ 1.1897314953572317650857593266280070162 × 10<sup>4932</sup>
{{spaces|42}}(largest number less than one)
(largest normal number)
 
3ffe3fff ffff0000 ffff0000 ffff0000 ffff0000 ffff0000 ffff0000 ffff0000<sub>16</sub> = 1 − 2<sup>−113</sup>(one)
≈ 0.9999999999999999999999999999999999037
(largest number less than one)
 
3fff 0000 0000 0000 0000 0000 0000 00000001<sub>16</sub> = 1 (one)+ 2<sup>−112</sup><br>
{{spaces|42}}≈ 1.0000000000000000000000000000000001926<br>
{{spaces|42}}(smallest number larger than one)
 
3fff4000 0000 0000 0000 0000 0000 0000 00010000<sub>16</sub> = 1 + 2<sup>−112</supbr>
ffffc000 0000 0000 0000 0000 0000 0000 0000<sub>16</sub> = −infinity−2
≈ 1.0000000000000000000000000000000001926
(smallest number larger than one)
 
40000000 0000 0000 0000 0000 0000 0000 0000<sub>16</sub> = 20<br>
c0008000 0000 0000 0000 0000 0000 0000 0000<sub>16</sub> = −2−0
 
00007fff 0000 0000 0000 0000 0000 0000 0000<sub>16</sub> = 0infinity<br>
8000ffff 0000 0000 0000 0000 0000 0000 0000<sub>16</sub> = −0−infinity
 
7fff4000 0000921f 0000b544 000042d1 00008469 0000898c 0000c517 000001b8<sub>16</sub> = infinity3.1415926535897932384626433832795027975<br>
{{spaces|42}}(closest approximation to π)
ffff 0000 0000 0000 0000 0000 0000 0000<sub>16</sub> = −infinity
 
40003ffd 921f5555 b5445555 42d15555 84695555 898c5555 c5175555 01b85555<sub>16</sub> ≈ 30.14159265358979323846264338327950279753333333333333333333333333333333333173<br>
{{spaces|42}}(closest approximation to π1/3)
|}
 
3ffd 5555 5555 5555 5555 5555 5555 5555<sub>16</sub> ≈ 0.3333333333333333333333333333333333173
(closest approximation to 1/3)
 
By default, 1/3 rounds down like [[double precision]], because of the odd number of bits in the significand. Thus, the bits beyond the rounding point are <code>0101...</code> which is less than 1/2 of a [[unit in the last place]].