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 (or binary or hexadecimal) point. For example, a fixed-point number with 4 digits after the decimal point could be used to store numbers such as 1.3467, 281243.3234 and 0.1000, but would round 1.0301789 to 1.0302 and 0.0000654 to 0.0001.
As long as the numeric value uses only the number of digits specified after the decimal point, fixed-point values can exactly represent all values up to its maximum value (determined by the number of bits in its representation). This is in contrast to floating-point representations, which include an automatically-managed exponent but cannot represent as many digits accurately (given the same number of bits in its representation).
A common use for fixed-point numbers is for storing monetary values, where the "inexact" values of floating-point numbers are often a liability. Fixed-point representations are also sometimes used if either the executing processor does not have any floating point unit (FPU) or if fixed-point provides an improved performance necessary for an application. Historically, fixed-point representations were the norm for decimal data types (for example, in PL/I or COBOL). The Ada programming language includes built-in support for both fixed-point and floating-point.
Many computer languages do not include built-in support for floating point values, because for most applications, floating-point representations are fast enough and accurate enough. Floating-point representations are more flexible than fixed-point representations, because they can handle a wider dynamic range. Floating-point representations are also slightly easier to use, because they do not require programmers to specify the number of digits after the decimal point.
Here are some high-profile uses of fixed-point representations: