Skip to main content
Module

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

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

Returns the largest of the given 2 natural numbers, of never otherwise

Examples

Example 1

Max<2, 5> => 5
Max<534, 424> => 534
Max<-4, 4> => never

Type Parameters

N1 extends number
N2 extends number
definition: N1 extends never ? never : N2 extends never ? never : Subtract<N1, N2> extends never ? N2 : N1