4 ms·
Small numbers with many representations are much more common than the full width ones.
by lvh 7y ago
Small numbers with many representations are much more common than the full width ones.
- Veedrac 7y agoThis is true, but hardly important. Multiple representations hurt because they waste space, not because they're transiently evil. If you're scared of normalizing before comparisons, or somesuch, nothing stops you normalizing around operations instead, like standard binary floats. Only you'd probably be shooting yourself in the foot, since you'd probably end up normalizing more and making the ‘integers are fast’ claim fail.
- hedora 7y agoIf you have to normalize DEC64 values, then the whole point of this format (1 cycle overhead for common “integer” operations on x64) evaporates. (In fairness, for small integers, the operators over normalized values are closed — they always return normalized values)
- Veedrac 7y agoThat was my point, yes. Being unnormalized is a good thing. IEEE does the same thing for their decimals. > (In fairness, for small integers, the operators over normalized values are closed — they always return normalized values) Normally normalization refers to using the smallest possible exponent; in this light small integers are unnormalized.