• 0 Posts
  • 3 Comments
Joined 3 years ago
cake
Cake day: September 1st, 2023

help-circle
  • Not mentioning fixed point in an article about floating point alternatives is a sin. Unlike any of the alternatives listed here (yes, even floating point), if your computer can do integers, fixed-point comes practically builtin! it’s literally the same machine instruction plus one or two bitwise shifts.

    Decimal floating point is probably the worst of every world. Without specialized hardware, implementing floating point is pretty hard in software, and comparatively slow. Since internally the decimals are stored in binary, a shift in the exponent means you have to recompute the mantissa as if you did multiplication or division, so you also lose the advantages of binary :)

    Fractions are probably the most practical implementation for arbitrary precision as they are base-agnostic, and thus, free of repeating fractionals. The problem is that you need to do lots of gcd and lcm for addition. I have never done a full implementation, but I’d say libraries represent them internally as mixed numbers, integer part and less-than-one fractional part.

    Symbolic computation is really hard. I hope you know your data structures and graph traversals!

    Interval arithmetic is niche and I didn’t pay attention to the lecture on measure errors so I’m not very familiar, but wikipedia says binary operations between intervals is literally matching and min/maxxing so this one may have the second simplest software implementation.

    For binary-coded decimal my guess is that decimal digits are stored as 4 bits each. Probably wasteful for any kind of arithmetic, so their use would mainly be conversions–after all, no matter how good binary is, people are used to decimal (which is not even that good of a base), and it’s the computer’s task to output that.