Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First off, neither IEEE-754-2008 nor -1985 have 16-bit floats; but it is a proposed addition with a 5-bit exponent and 10-bit fraction. IEE-754 uses a dedicated sign bit, so the positive and negative range is the same. Also, the fraction has an implied 1 in front, so you get an extra bit.</p> <p>If you want accuracy to the ones place, as in you can represent each integer, the answer is fairly simple: The exponent shifts the decimal point to the right-end of the fraction. So, a 10-bit fraction gets you ±2<sup>11</sup>.</p> <p>If you want one bit after the decimal point, you give up one bit before it, so you have ±2<sup>10</sup>.</p> <p>Single-precision has a 23-bit fraction, so you'd have ±2<sup>24</sup> integers.</p> <p>How many bits of precision you need after the decimal point depends entirely on the calculations you're doing, and how many you're doing.</p> <ul> <li>2<sup>10</sup> = 1,024</li> <li>2<sup>11</sup> = 2,048</li> <li>2<sup>23</sup> = 8,388,608</li> <li>2<sup>24</sup> = 16,777,216</li> <li>2<sup>53</sup> = 9,007,199,254,740,992 (double-precision)</li> <li>2<sup>113</sup> = 10,384,593,717,069,655,257,060,992,658,440,192 (quad-precision)</li> </ul> <h2>See also</h2> <ul> <li><a href="https://en.wikipedia.org/wiki/Double_precision" rel="nofollow noreferrer" title="Double-precision on Wikipedia">Double-precision</a></li> <li><a href="https://en.wikipedia.org/wiki/Half_precision" rel="nofollow noreferrer" title="Half-precision on Wikipedia">Half-precision</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload