No matching definitions.

tur/float-range

stdlib/float-range.tur

FloatRange: continuous interval with inclusive or exclusive ends.

Since: Phase RR4

defn

float-range-bound-new

(float-range-bound-new [inclusive :int value :float] :int)

allocate a FloatRangeBound with given inclusivity and value.

inclusive1 for inclusive, 0 for exclusive
valuethe endpoint value (float64)

int64_t pointer to a heap FloatRangeBound.

Since: RR4

defn

float-range-bound-inclusive?

(float-range-bound-inclusive? [b :int] :bool)

true if the bound is inclusive.

bint64_t pointer to a FloatRangeBound (must not be 0)

Since: RR4

defn

float-range-bound-value

(float-range-bound-value [b :int] :float)

return the endpoint value of a bound.

bint64_t pointer to a FloatRangeBound (must not be 0)

Since: RR4

defn

float-range-new

(float-range-new [lower :int upper :int] :int)

allocate a FloatRange from lower and upper bound pointers.

lower0 for unbounded below, else FloatRangeBound pointer
upper0 for unbounded above, else FloatRangeBound pointer

int64_t pointer to a heap FloatRange.

Since: RR4

defn

float-range-lower

(float-range-lower [r :int] :int)

return the lower bound pointer (0 = unbounded).

rint64_t pointer to a FloatRange

Since: RR4

defn

float-range-upper

(float-range-upper [r :int] :int)

return the upper bound pointer (0 = unbounded).

rint64_t pointer to a FloatRange

Since: RR4

defn

float-range-val-in-lower?

(float-range-val-in-lower? [lower :int v :float] :bool)

check value against a lower bound.

defn

float-range-val-in-upper?

(float-range-val-in-upper? [upper :int v :float] :bool)

check value against an upper bound.

defn

float-closed-range

(float-closed-range [lo :float hi :float] :int)

[lo, hi] both endpoints inclusive.

lolower bound value
hiupper bound value

A FloatRange representing [lo, hi].

(float-closed-range 0.0 1.0)  ; => [0.0, 1.0]

Since: RR4

defn

float-open-range

(float-open-range [lo :float hi :float] :int)

(lo, hi) both endpoints exclusive.

lolower bound value (excluded)
hiupper bound value (excluded)

A FloatRange representing (lo, hi).

(float-open-range 0.0 1.0)  ; => (0.0, 1.0)

Since: RR4

defn

float-closed-open-range

(float-closed-open-range [lo :float hi :float] :int)

[lo, hi) inclusive lower, exclusive upper.

lolower bound value (included)
hiupper bound value (excluded)

A FloatRange representing [lo, hi).

(float-closed-open-range 0.0 1.0)  ; => [0.0, 1.0)

Since: RR4

defn

float-open-closed-range

(float-open-closed-range [lo :float hi :float] :int)

(lo, hi] exclusive lower, inclusive upper.

lolower bound value (excluded)
hiupper bound value (included)

A FloatRange representing (lo, hi].

(float-open-closed-range 0.0 1.0)  ; => (0.0, 1.0]

Since: RR4

defn

float-at-least-range

(float-at-least-range [lo :float] :int)

[lo, +inf) inclusive lower, unbounded above.

lolower bound value (included)

A FloatRange representing [lo, +inf).

(float-at-least-range 0.0)  ; => [0.0, +inf)

Since: RR4

defn

float-greater-than-range

(float-greater-than-range [lo :float] :int)

(lo, +inf) exclusive lower, unbounded above.

lolower bound value (excluded)

A FloatRange representing (lo, +inf).

(float-greater-than-range 0.0)  ; => (0.0, +inf)

Since: RR4

defn

float-at-most-range

(float-at-most-range [hi :float] :int)

(-inf, hi] unbounded below, inclusive upper.

hiupper bound value (included)

A FloatRange representing (-inf, hi].

(float-at-most-range 1.0)  ; => (-inf, 1.0]

Since: RR4

defn

float-less-than-range

(float-less-than-range [hi :float] :int)

(-inf, hi) unbounded below, exclusive upper.

hiupper bound value (excluded)

A FloatRange representing (-inf, hi).

(float-less-than-range 1.0)  ; => (-inf, 1.0)

Since: RR4

defn

float-singleton-range

(float-singleton-range [v :float] :int)

[v, v] a range containing exactly one value.

vthe single value

A FloatRange representing [v, v].

(float-singleton-range 0.5)  ; => [0.5, 0.5]

Since: RR4

defn

float-unbounded-range

(float-unbounded-range :int)

(-inf, +inf) no bounds at all.

A FloatRange representing all float values.

(float-unbounded-range)  ; => (-inf, +inf)

Since: RR4

defn

float-range-contains?

(float-range-contains? [r :int v :float] :bool)

true if value v falls within float range r.

rint64_t pointer to a FloatRange
vfloat value to test

true if v satisfies both the lower and upper bounds of r.

(float-range-contains? (float-closed-range 0.0 1.0) 0.5)  ; => true
  (float-range-contains? (float-open-range 0.0 1.0) 0.0)    ; => false

Since: RR4