ToNegative<N>:N extends number ? N extends 0 ? 0 : `-${N}` extends `${infer W extends number}` ? W : N : N extends 0n ? 0n : `-${N}` extends `${infer W extends bigint}` ? W : N
Converts a number or bigint N to negative.
If N is already negative, it returns itself.
Converts a number or bigint
N
to negative. IfN
is already negative, it returns itself.