Type Alias IsNegative<T, $O>

IsNegative<T, $O>: IsBigint<T, {
        $else: $Else;
        $then: $Then;
        distributive: $O["distributive"];
    }> extends infer R
    ? R extends $Then
        ? NumberPlus.IsNegative._Negative<T, bigint, $O>
        : IsNumber<Exclude<T, bigint>, {
                $else: $Else;
                $then: $Then;
                distributive: $O["distributive"];
            }> extends infer R
            ? R extends $Then
                ? NumberPlus.IsNegative._Negative<T, number, $O>
                : $ResolveBranch<T, $O, [$Else]>
            : never
    : never

Is T a negative numeric type.

type R = IsNegative<-1> // true
type R = IsNegative<-1n> // true

type R = IsNegative<0> // false
type R = IsNegative<1> // false

type R = IsNegative<number> // boolean
type R = IsNegative<bigint> // boolean
type R = IsNegative<any> // boolean

Type Parameters