Skip to content
Tech News
← Back to articles

Show HN: I made a calculator that works over disjoint sets of intervals

read original get Interval Math Calculator → more articles
Why This Matters

This innovative calculator extends traditional interval arithmetic to handle unions of disjoint intervals, enabling more accurate modeling of uncertainty and complex computations in the presence of division by zero and floating-point limitations. Its ability to maintain closure and include guarantees makes it a valuable tool for developers and researchers working with uncertain data or numerical analysis.

Key Takeaways

What is this?

This is a calculator that works over unions of intervals rather than just real numbers. It is an implementation of Interval Union Arithmetic.

An interval [a, b] represents the set of all numbers between and including a and b. An interval union: [a, b] U [c, d] is a disjoint set of intervals.

Interval union arithmetic is an extension of regular interval arithmetic that is vastly superior, mostly because it remains closed while supporting division by intervals containing zero:

➤ 2 / [-2, 1] [-∞, -1] U [2, +∞]

The interesting thing about interval union arithmetic is the inclusion property, which means that if you pick any real number from every input union and compute the same expression over the reals, the result is guaranteed to be in the output union.

You can use it to represent uncertainty:

➤ 50 * (10 + [-1, 1]) [450, 550]

You can also compute more complex interval expressions, using the interval union operator U :

➤ ( [5, 10] U [15, 16] ) / [10, 100] [0.05, 1.6]

... continue reading