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
Fixed-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!
{{short description|Computer format for representing real numbers}} {{about|fixed-precision fractions|the invariant points of a function|Fixed point (mathematics)}} {{Original research|date=September 2019}} {{Use dmy dates|date=December 2022|cs1-dates=y}} {{Use list-defined references|date=December 2022}} {{Use American English|date=September 2024}} In [[computing]], '''fixed-point''' is a method of representing [[fraction (mathematics)|fractional]] (non-integer) numbers by storing a fixed number of digits of their fractional part. [[US dollar|Dollar]] amounts, for example, are often stored with exactly two fractional digits, representing the [[cent (currency)|cents]] (1/100 of dollar). More generally, the term may refer to representing fractional values as integer multiples of some fixed small unit, e.g. a fractional amount of hours as an integer multiple of ten-minute intervals. Fixed-point number representation is often contrasted to the more complicated and computationally demanding [[floating-point representation]]. In the fixed-point representation, the fraction is often expressed in the same [[number base]] as the integer part, but using negative [[exponentiation|powers]] of the base ''b''. The most common variants are [[decimal]] (base 10) and [[binary number|binary]] (base 2). The latter is commonly known also as '''binary scaling'''. Thus, if ''n'' fraction digits are stored, the value will always be an integer [[multiple (mathematics)|multiple]] of ''b''<sup>β''n''</sup>. Fixed-point representation can also be used to omit the low-order digits of integer values, e.g. when representing large dollar values as multiples of $1000. When decimal fixed-point numbers are displayed for human reading, the fraction digits are usually separated from those of the integer part by a [[radix character]] (usually '.' in English, but ',' or some other symbol in many other languages). Internally, however, there is no separation, and the distinction between the two groups of digits is defined only by the programs that handle such numbers. Fixed-point representation was the norm in [[mechanical calculator]]s. Since most modern [[Processor (computing)|processors]] have a fast [[floating-point unit]] (FPU), fixed-point representations in processor-based implementations are now used only in special situations, such as in low-cost [[embedded system|embedded]] [[microprocessor]]s and [[microcontroller]]s; in applications that demand high speed or low [[electric power|power]] consumption or small [[integrated circuit|chip]] area, like [[image processing|image]], [[video processing|video]], and [[digital signal processing]]; or when their use is more natural for the problem. Examples of the latter are [[accounting]] of dollar amounts, when fractions of cents must be rounded to whole cents in strictly prescribed ways; and the evaluation of [[function (mathematics)|functions]] by [[table lookup]], or any application where rational numbers need to be represented without rounding errors (which fixed-point does but floating-point cannot). Fixed-point representation is still the norm for [[field-programmable gate array]] (FPGA) implementations, as floating-point support in an FPGA requires significantly more resources than fixed-point support.<ref name="Wong_2017"/>
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)