Skip to main content
Module

x/rimbu/typical/mod.ts>Num.InRange

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
type alias Num.InRange
import { type Num } from "https://deno.land/x/rimbu@0.12.3/typical/mod.ts";
const { InRange } = Num;

Returns true if the given number is greater than or equal to given L, and less than or equal to given H, and returns false otherwise.

Examples

Example 1

InRange<4, 5, 10> => false
InRange<6, 5, 10> => true
InRange<5, 5, 10> => true

Type Parameters

N extends number
L extends number
H extends number
definition: GreaterThanOrEqual<N, L> & LessThanOrEqual<N, H> extends never ? false : true