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

x/rimbu/typical/num.ts>Max

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

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