Type alias Max<A, B>

Max<A, B>: IsNegative<A> extends true
    ? IsNegative<B> extends true
        ? _MaxNegative<Abs<A>, Abs<B>, A, B>
        : B
    : IsNegative<B> extends true
        ? A
        : _MaxPositive<A, B>

Returns the larger of two numeric literals.

Handles positive literals, negative literals, mixed signs, and zero.

Type Parameters

Example

type A = Max<3, 7>;
// ^? 7

type B = Max<-9, -4>;
// ^? -4

type C = Max<-3, 0>;
// ^? 0