Content deleted Content added
Petedarnell (talk | contribs) mNo edit summary |
Petedarnell (talk | contribs) No edit summary |
||
Line 3:
{{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.
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: <math>\left({bm-1}\right)^2-1 + {bf^2-1 \over bf^2}\mbox{ where } bm \mbox{ is bits of magnitude and }bf \mbox{is bits of fraction}</math>.
For example, a 16 bit signed fixed-point binary number with 4 bits after the
For example, one-tenth (.1) and one-hundredth (.01) can be represented only approximately
by two's complement fixed point or floating point representations, while they can be represented exactly in BCD representations.
Integer fixed-point values are aways exactly
A common use for fixed-point BCD numbers is for storing monetary values, where the inexact values
|