floordecimal
Floordecimal is a fixed-point decimal numeric representation that uses floor rounding to a fixed number of decimal places. In floordecimal, numbers are stored as integers representing the value multiplied by 10^p, where p is the number of fractional digits. For example, with p = 2, the value 12.345 is stored as 1234, since floor(12.345 × 100) = 1234, yielding 12.34. Negative values follow the same rule, so -12.345 becomes -12.35 because floor(-1234.5) = -1235.
Operations on floordecimals are performed at the defined precision p. Addition and subtraction are straightforward, while
Example with p = 2: 1.99 (stored as 199) plus 0.01 (stored as 1) yields 200, which corresponds
Use cases for floordecimal include systems where deterministic, bias-free downward rounding is required, such as certain