Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

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

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

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>