Type alias Min<A, B>

Min<A, B>: IsNegative<A> extends true
    ? IsNegative<B> extends true
        ? _MinNegative<Abs<A>, Abs<B>, A, B>
        : A
    : IsNegative<B> extends true
        ? B
        : _MinPositive<A, B>

Returns the smaller of two numeric literals.

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

Type Parameters

Example

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

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

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