MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / intervalContains

Function intervalContains

src/compute-engine/numerics/interval.ts:97–103  ·  view source on GitHub ↗
(int: Interval, val: number)

Source from the content-addressed store, hash-verified

95}
96
97export function intervalContains(int: Interval, val: number): boolean {
98 // Lower bound: reject values below `start` (or at it, if the start is open).
99 if (int.openStart ? val <= int.start : val < int.start) return false;
100 // Upper bound: reject values above `end` (or at it, if the end is open).
101 if (int.openEnd ? val >= int.end : val > int.end) return false;
102 return true;
103}
104
105/** Return true if int1 is a subset of int2 */
106export function intervalSubset(int1: Interval, int2: Interval): boolean {

Callers 2

collections.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected