Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Floating-point arithmetic
(section)
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!
{{Redirect|Floating point}} {{Short description|Computer approximation for real numbers}} {{Use dmy dates|date=May 2019|cs1-dates=y}} [[File:Z3 Deutsches Museum.JPG|thumb|200px|An early electromechanical programmable computer, the [[Z3 (computer)|Z3]], included floating-point arithmetic (replica on display at [[Deutsches Museum]] in [[Munich]]).]] {{Floating-point}} In [[computing]], '''floating-point arithmetic''' ('''FP''') is [[arithmetic]] on subsets of [[real number]]s formed by a ''[[significand]]'' (a [[Sign (mathematics)|signed]] sequence of a fixed number of digits in some [[Radix|base]]) multiplied by an [[integer power]] of that base. Numbers of this form are called '''floating-point numbers'''.<ref name="Muller_2010"/>{{rp|3}}<ref name="sterbenz1974fpcomp">{{cite book |last1=Sterbenz |first1=Pat H. |title=Floating-Point Computation |date=1974 |publisher=Prentice-Hall |location=Englewood Cliffs, NJ, United States |isbn=0-13-322495-3 |url=https://archive.org/details/SterbenzFloatingPointComputation/mode/2up}}</ref>{{rp|10}} For example, the number 2469/200 is a floating-point number in base ten with five digits: <math display=block>2469/200 = 12.345 = \! \underbrace{12345}_\text{significand} \! \times \! \underbrace{10}_\text{base}\!\!\!\!\!\!\!\overbrace{{}^{-3}}^{\text{exponent}}</math> However, 7716/625 = 12.3456 is not a floating-point number in base ten with five digits—it needs six digits. The nearest floating-point number with only five digits is 12.346. And 1/3 = 0.3333β¦ is not a floating-point number in base ten with any finite number of digits. In practice, most floating-point systems use [[Binary number|base two]], though base ten ([[decimal floating point]]) is also common. Floating-point arithmetic operations, such as addition and division, approximate the corresponding real number arithmetic operations by [[rounding]] any result that is not a floating-point number itself to a nearby floating-point number.<ref name="Muller_2010"/>{{rp|22}}<ref name="sterbenz1974fpcomp"/>{{rp|10}} For example, in a floating-point arithmetic with five base-ten digits, the sum 12.345 + 1.0001 = 13.3451 might be rounded to 13.345. The term ''floating point'' refers to the fact that the number's [[radix point]] can "float" anywhere to the left, right, or between the [[significant digits]] of the number. This position is indicated by the exponent, so floating point can be considered a form of [[scientific notation]]. A floating-point system can be used to represent, with a fixed number of digits, numbers of very different [[Orders of magnitude (numbers)|orders of magnitude]] β such as the number of meters [[Orders of magnitude (length)#100_zettametres|between galaxies]] or [[Orders of magnitude (length)#10_femtometres|between protons in an atom]]. For this reason, floating-point arithmetic is often used to allow very small and very large real numbers that require fast processing times. The result of this [[dynamic range]] is that the numbers that can be represented are not uniformly spaced; the difference between two consecutive representable numbers varies with their exponent.<ref name="Smith_1997"/> [[File:A number line representing single-precision floating point's numbers and numbers that it cannot display.png|500x500px|thumb|right|Single-precision floating-point numbers on a [[number line]]: the green lines mark representable values.]] [[File:FloatingPointPrecisionAugmented.png|500x500px|thumb|right|Augmented version above showing both [[Signed number representations|signs]] of representable values]] Over the years, a variety of floating-point representations have been used in computers. In 1985, the [[IEEE 754]] Standard for Floating-Point Arithmetic was established, and since the 1990s, the most commonly encountered representations are those defined by the IEEE. The speed of floating-point operations, commonly measured in terms of [[FLOPS]], is an important characteristic of a [[computer system]], especially for applications that involve intensive mathematical calculations. A [[floating-point unit]] (FPU, colloquially a math [[coprocessor]]) is a part of a computer system specially designed to carry out operations on floating-point numbers.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)