|
|
|
|
|
by kstenerud
1650 days ago
|
|
But it can be shaped by rules to be associative enough to be useful for the common case. All you need to do is ensure that your calculations are in no danger of blowing past the max significant digits (much like you'd guard against overflow on integer types). Once you need more range, you switch to a multi-word numeric format (or impose rounding rules). |
|
If you have a lot of control of the scale of the numbers you’re computing with, you could use fixed point instead of floating point.
The situations that make it useful to have a floating point (rather than fixed point) are also the situations where addition isn’t associative.