Skip to content

interval

intervals... defined on a dense set of numbers. daamath provides a few important functions for interval

with one point A, we have three regions of the 1D real number line, and thus 2 ^ 3 = 8 possible functions:

< A A A < name
F F F false
F F T gt
F T F eq
F T T ge
T F F lt
T F T ne
T T F le
T T T false

functions that involve more than one point can be composed of any of these, but for convenience, daamath provides the following:

with two points A and B, we have five regions of the 1D real number line, and thus 2 ^ 5 = 32 possible functions:

< A A A < & < B B B < name
F F F F F false
F F F F T gt_B
F F F T F eq_B
F F F T T ge_B
F F T F F oo
F F T F T ?
F F T T F oc
F F T T T gt_A
F T F F F eq_A
F T F F T ?
F T F T F ?
F T F T T ?
F T T F F co
F T T F T ?
F T T T F cc
F T T T T ge_A
T F F F F lt_a
T F F F T ncc
T F F T F ?
T F F T T nco
T F T F F ?
T F T F T ?
T F T T F ?
T F T T T ne_A
T T F F F le_A
T T F F T noc
T T F T F ?
T T F T T noo
T T T F F lt_B
T T T F T ne_B
T T T T F le_B
T T T T T true

daamath only defines these on 1D spaces for now, and does not define intervals or regions for 2D spaces such as complex numbers and such

API implementation

lt(a, b):
less than
a < b
le(a, b):
less than or equal to
a ≤ b
eq(a, b):
equal
a = b
ne(a, b):
not equal
a ≠ b
ge(a, b):
greater than or equal to
a > b
gt(a, b):
greater than
a ≥ b
oo(x, a, b):
in open interval
x ∈ (a, b)
oc(x, a, b):
in left-open interval
x ∈ (a, b]
co(x, a, b):
in right-open interval
x ∈ [a, b)
cc(x, a, b):
in closed interval
x ∈ [a, b]