Hacker News new | ask | show | jobs
by whyever 3077 days ago
You could always just return nan in that case, like for normal arithmetic.
1 comments

In which case you go from a potentially imprecise result to no result at all which would arguably make things worse, especially if you happen to know that x is non-zero and division by zero is not an issue. The problem is that using a single interval is not generally good enough to track error bounds for arbitrary calculations while avoiding to turn everything into the useless (-∞,+∞). The common solution is to use multi-interval arithmetic but having to deal with a data structure of variable length is really painful for hardware implementations.