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!
=== Alternatives to floating-point numbers === The floating-point representation is by far the most common way of representing in computers an approximation to real numbers. However, there are alternatives: * [[Fixed-point arithmetic|Fixed-point]] representation uses integer hardware operations controlled by a software implementation of a specific convention about the location of the binary or decimal point, for example, 6 bits or digits from the right. The hardware to manipulate these representations is less costly than floating point, and it can be used to perform normal integer operations, too. Binary fixed point is usually used in special-purpose applications on embedded processors that can only do integer arithmetic, but decimal fixed point is common in commercial applications. * [[Logarithmic number system]]s (LNSs) represent a real number by the logarithm of its absolute value and a sign bit. The value distribution is similar to floating point, but the value-to-representation curve (''i.e.'', the graph of the logarithm function) is smooth (except at 0). Conversely to floating-point arithmetic, in a logarithmic number system multiplication, division and exponentiation are simple to implement, but addition and subtraction are complex. The ([[symmetric level-index arithmetic|symmetric]]) [[level-index arithmetic]] (LI and SLI) of Charles Clenshaw, [[Frank William John Olver|Frank Olver]] and Peter Turner is a scheme based on a [[generalized logarithm]] representation. * [[Tapered floating-point representation]], used in [[Unum (number format)|Unum]]. * Some simple rational numbers (''e.g.'', 1/3 and 1/10) cannot be represented exactly in binary floating point, no matter what the precision is. Using a different radix allows one to represent some of them (''e.g.'', 1/10 in decimal floating point), but the possibilities remain limited. Software packages that perform [[fraction|rational arithmetic]] represent numbers as fractions with integral numerator and denominator, and can therefore represent any rational number exactly. Such packages generally need to use "[[bignum]]" arithmetic for the individual integers. * [[Interval arithmetic]] allows one to represent numbers as intervals and obtain guaranteed bounds on results. It is generally based on other arithmetics, in particular floating point. * [[Computer algebra system]]s such as [[Mathematica]], [[Maxima (software)|Maxima]], and [[Maple (software)|Maple]] can often handle irrational numbers like <math>\pi</math> or <math>\sqrt{3}</math> in a completely "formal" way ([[symbolic computation]]), without dealing with a specific encoding of the significand. Such a program can evaluate expressions like "<math>\sin (3\pi)</math>" exactly, because it is programmed to process the underlying mathematics directly, instead of using approximate values for each intermediate calculation.
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)