Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/rimbu/typical/num.ts>IsNatural

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

Returns true if the given number is a natural number (>= 0), false otherwise

Examples

Example 1

IsNatural<9> => true
IsNatural<0> => true
IsNatural<-5> => false

Type Parameters

N extends number
definition: GreaterThanOrEqual<N, 0>