it is indeed done like this :(
but since 3 is bitmask of 1 and 2, we do not need to replicate the exact same implementation :-)

side rant: it seems the original implementor of datatypes did not like to use NULL with a separate meaning from 0, so he did this ugly thing of storing min/max in 2 cols and using an extra col with the bitmask of which limit was actually set. it makes me sad to this day