logoalt Hacker News

mike-the-mikadoyesterday at 10:42 AM0 repliesview on HN

I recently implemented something somewhat similar, but from the perspective of set membership.

I therefore needed to include a complement operation, so that I could do full Boolean analysis of interval membership.

Your intervals are all closed sets, consequently the complements are open intervals. I chose not to distinguish between open and closed intervals, since for my practical purposes whether the end points are members of the set is unimportant.

Of course, with inexact arithmetic, the question of whether the set is open of closed probably not well-defined.