The right endpoint of the interval
The left endpoint of the interval
Sets new endpoints for this interval checking that both arguments exist
and that are valid numbers, additionally if lo > hi
the interval is set to
an empty interval
The calling interval
The left endpoint of the interval
The right endpoint of the interval
Sets new endpoints to this interval, the left endpoint is equal to the
previous IEEE floating point value of lo
and the right endpoint
is equal to the next IEEE floating point
value of hi
, it's assumed that lo <= hi
const x = Interval().bounded(1, 2)
x.lo < 1 // true, x.lo === 0.9999999999999999
x.hi > 2 // true, x.hi === 2.0000000000000004
// the correct representation of 1/3
var x = Interval().bounded(1/3, 1/3)
x.lo < 1/3 // true
x.hi > 1/3 // true
// however the floating point representation of 1/3 is less than the real 1/3
// therefore the left endpoint could be 1/3 instead of the previous value of
var next = Interval.round.safeNext
var x = Interval().set(1/3, next(1/3))
// x now represents 1/3 correctly
The calling interval i.e. this
Sets the endpoints of this interval to the half open interval (lo, hi]
NOTE: Interval.round.disable
has no effect on this method
// (2, 3]
Interval().halfOpenLeft(2, 3) // {lo: 2.0000000000000004, hi: 3}
The calling interval
Sets the endpoints of this interval to the half open interval [lo, hi)
NOTE: Interval.round.disable
has no effect on this method
// [2, 3)
Interval.halfOpenRight(2, 3) // {lo: 2, hi: 2.9999999999999996}
The calling interval
Sets the endpoints of this interval to the open interval (lo, hi)
NOTE: Interval.round.disable
has no effect on this method
// (2, 3)
Interval().open(2, 3) // {lo: 2.0000000000000004, hi: 2.9999999999999996}
The calling interval
Generated using TypeDoc
Constructor for closed intervals representing all the values inside (and including)
lo
andhi
e.g.[lo, hi]
NOTE: If
lo > hi
then the constructor will return an empty intervalMixes
arithmetic
Mixes
algebra
Mixes
misc
Mixes
relational
Mixes
trigonometric
Mixes
utils
Mixes
constants
Link
#bounded
Link
#boundedSingleton
Example
Param
The left endpoint of the interval if it's a number or a singleton interval, if it's an array then an interval will be built out of the elements of the array
Param
The right endpoint of the interval if it's a number or a singleton interval, if omitted then a singleton interval will be built out of
lo