3 ms·
Would it be useful to have a 'fraction' type that represents values in [0,1] with uniform precision? Then instead of time deltas, we could work with fractions
by mleonhard 5y ago
Would it be useful to have a 'fraction' type that represents values in [0,1] with uniform precision?
Then instead of time deltas, we could work with fractions of the animation period.
When switching from float to fraction, we can remove code that handles float's edge cases: +inf, -inf, NaN, -0.0, non-canonical encodings, and loss of precision.
- addaon 5y agoWe have various integer types, and e.g. a 0.32 or 0.16 fixed point representation is trivial on top of integer types; and is also the only efficient uniform representation on [0, 1) (which is probably more valuable than [0, 1]).