12 points vismit2000 2 days ago 7 comments

MiroslavPokorny 2 days ago | parent

Strange the most obvious - fixed point numbers is not mentioned.

cryptonector 1 hour ago | parent

Nor unums!!

schiffern 1 day ago | parent

None of the base 10 formats, but the hobby calculation language Frink supports exact rational fractions, arbitrary width bigints (not pictured), intervals arithmetic, and symbolic expressions.

https://frinklang.org/fsp/frink.fsp?fromVal=new+interval%5B-...

AlotOfReading 1 hour ago | parent

Usually, if you know enough about your algorithms to select an appropriate float alternative, you also know enough to fix your float code and that's what you should actually do.

That said, some of these aren't alternatives. Symbolic computation is a different thing entirely. Interval arithmetic can be built atop floats (e.g. IEEE-1788) and has its own zoo of unintuitive behaviors. BCD is better called a historical artifact than an alternative these days.

It's really just rationals and decimal floats in this list, which probably don't solve the issues you have if you're considering float alternatives.

klodolph 54 minutes ago | parent

Worth mentioning is storing the logarithm of the number.

Seen it used in a couple places. Logarithmic depth buffer is one. Yamaha DX7 is another.

mtklein 43 minutes ago | parent

That's kind of exactly what floats are. You store the log2 of the number, a bit for its sign, and in what remaining bits you have left some fixed-point scaling between adjacent powers.