# Is there interval notation for out-of-range?

I often find code that checks for out of range values, as in:

if (x < 5 or x > 6) {
// do stuff...
}


I like to rearrange it to get a slightly better visual cue:

if (x < 5 or 6 < x) {
// do stuff...
}


My question is whether there is mathematical notation for that. I'm no mathematician; I know about inequality/comparison operators and interval notation for closed and open-ended (between) ranges, but I have yet to stumble upon a good, concise representation for out-of-range.

I'm left with writing the inequalities, or the rather clumsy "all except" interval notation (−∞,5) ∪ (6,∞), So let's say I propose something in the lines of

<a,b<


as new interval notation; how would I go about getting it accepted?

• How about $x \notin [5,6]$? – mhum Apr 6 '18 at 23:21
• Brilliant, negation--of course. Now I feel silly. Thanks! – thor2k Apr 9 '18 at 0:32