Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
IEEE 754-1985
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Range and precision == [[File:IEEE 754 relative precision.svg|thumb|Relative precision of single (binary32) and double precision (binary64) numbers, compared with decimal representations using a fixed number of [[significant digits]]. Relative precision is defined here as ulp(''x'')/''x'', where ulp(''x'') is the [[unit in the last place]] in the representation of ''x'', i.e. the gap between ''x'' and the next representable number.]] Precision is defined as the minimum difference between two successive mantissa representations; thus it is a function only in the mantissa; while the gap is defined as the difference between two successive numbers.<ref>{{citation |title=Computer Arithmetic |author1=Hossam A. H. Fahmy |author2=Shlomo Waser |author3=Michael J. Flynn |url=http://arith.stanford.edu/~hfahmy/webpages/arith_class/arith.pdf |access-date=2011-01-02 |url-status=dead |archive-url=https://web.archive.org/web/20101008203307/http://arith.stanford.edu/~hfahmy/webpages/arith_class/arith.pdf |archive-date=2010-10-08}}</ref> === Single precision === [[Single-precision]] numbers occupy 32 bits. In single precision: * The positive and negative numbers closest to zero (represented by the denormalized value with all 0s in the exponent field and the binary value 1 in the fraction field) are *: Β±2<sup>−23</sup> × 2<sup>−126</sup> β Β±1.40130{{e|β45}} * The positive and negative normalized numbers closest to zero (represented with the binary value 1 in the exponent field and 0 in the fraction field) are *: Β±1 × 2<sup>−126</sup> β Β±1.17549{{e|β38}} * The finite positive and finite negative numbers furthest from zero (represented by the value with 254 in the exponent field and all 1s in the fraction field) are *: Β±(2β2<sup>β23</sup>) × 2<sup>127</sup><ref name="Kahan">{{Cite web | author = William Kahan |author-link=William Kahan | title = Lecture Notes on the Status of IEEE 754 | date = October 1, 1997 | publisher = University of California, Berkeley | url = http://www.cs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF | access-date = 2007-04-12 }}</ref> β Β±3.40282{{e|38}} Some example range and gap values for given exponents in single precision: {| class="wikitable" style="text-align:right;" |- style="text-align:center;" ! Actual Exponent (unbiased) ! Exp (biased) ! Minimum ! Maximum ! Gap |- | β1 | 126 | 0.5 | β 0.999999940395 | β 5.96046e-8 |- | 0 | 127 | 1 | β 1.999999880791 | β 1.19209e-7 |- | 1 | 128 | 2 | β 3.999999761581 | β 2.38419e-7 |- | 2 | 129 | 4 | β 7.999999523163 | β 4.76837e-7 |- | 10 | 137 | 1024 | β 2047.999877930 | β 1.22070e-4 |- | 11 | 138 | 2048 | β 4095.999755859 | β 2.44141e-4 |- | 23 | 150 | 8388608 | 16777215 | 1 |- | 24 | 151 | 16777216 | 33554430 | 2 |- | 127 | 254 | β 1.70141e38 | β 3.40282e38 | β 2.02824e31 |} As an example, 16,777,217 cannot be encoded as a 32-bit float as it will be rounded to 16,777,216. However, all integers within the representable range that are a power of 2 can be stored in a 32-bit float without rounding. === Double precision === [[Double-precision]] numbers occupy 64 bits. In double precision: * The positive and negative numbers closest to zero (represented by the denormalized value with all 0s in the Exp field and the binary value 1 in the Fraction field) are *: Β±2<sup>−52</sup> × 2<sup>−1022</sup> β Β±4.94066{{e|β324}} * The positive and negative normalized numbers closest to zero (represented with the binary value 1 in the Exp field and 0 in the fraction field) are *: Β±1 × 2<sup>−1022</sup> β Β±2.22507{{e|β308}} * The finite positive and finite negative numbers furthest from zero (represented by the value with 2046 in the Exp field and all 1s in the fraction field) are *: Β±(2β2<sup>β52</sup>) × 2<sup>1023</sup><ref name="Kahan" /> β Β±1.79769{{e|308}} Some example range and gap values for given exponents in double precision: {| class="wikitable" style="text-align:right;" |- style="text-align:center;" ! Actual Exponent (unbiased) ! Exp (biased) ! Minimum ! Maximum ! Gap |- | β1 | 1022 | 0.5 | β 0.999999999999999888978 | β 1.11022e-16 |- | 0 | 1023 | 1 | β 1.999999999999999777955 | β 2.22045e-16 |- | 1 | 1024 | 2 | β 3.999999999999999555911 | β 4.44089e-16 |- | 2 | 1025 | 4 | β 7.999999999999999111822 | β 8.88178e-16 |- | 10 | 1033 | 1024 | β 2047.999999999999772626 | β 2.27374e-13 |- | 11 | 1034 | 2048 | β 4095.999999999999545253 | β 4.54747e-13 |- | 52 | 1075 | 4503599627370496 | 9007199254740991 | 1 |- | 53 | 1076 | 9007199254740992 | 18014398509481982 | 2 |- | 1023 | 2046 | β 8.98847e307 | β 1.79769e308 | β 1.99584e292 |} === Extended formats === The standard also recommends extended format(s) to be used to perform internal computations at a higher precision than that required for the final result, to minimise round-off errors: the standard only specifies minimum precision and exponent requirements for such formats. The [[x87]] [[extended precision|80-bit extended format]] is the most commonly implemented extended format that meets these requirements.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
IEEE 754-1985
(section)
Add topic