Fixed-point arithmetic: Difference between revisions

Content deleted Content added
Fredrik (talk | contribs)
mNo edit summary
mNo edit summary
Line 1:
{{dablink|This article is about a form of limited-precision arithmetic in computing. For the fixed points of a mathematical function, see [[fixed point (mathematics)]].}}
 
In [[computing]], a '''fixed-point number''' representation is a [[real data type]] for a number that has a fixed number of digits after the decimal (binary or radix) point. Fixed-point numbers are useful for representing fractional values in native two's complement format if the executing processor has no [[floating point]] unit (FPU) or if fixed-point provides improved performance or accuracy. Most low-cost embedded processors do not have an [[FPU]].
improved performance. Most low cost embedded processors do not have an FPU.
 
The bits to the left of the radix point are magnitude bits that represent integer values, the bits to the right of the radix point represent fractional values. Each fractional bit represents an inverse power of 2. Thus the first fractional bit is 1/2, the second is 1/4, the third is 1/8 and so on. For signed fixed point numbers in [[two's complement]] format, the upper bound is given by