Returns the absolute value of the specified number or bigint.
import type {Absolute} from 'type-fest';type A = Absolute<-1>;//=> 1type B = Absolute<1>;//=> 1type C = Absolute<0>;//=> 0type D = Absolute<-1.025>;//=> 1.025type E = Absolute<-9999n>;//=> 9999n Copy
import type {Absolute} from 'type-fest';type A = Absolute<-1>;//=> 1type B = Absolute<1>;//=> 1type C = Absolute<0>;//=> 0type D = Absolute<-1.025>;//=> 1.025type E = Absolute<-9999n>;//=> 9999n
Returns back the same type if the input is not a literal type.
import type {Absolute} from 'type-fest';type A = Absolute<number>;//=> numbertype B = Absolute<bigint>;//=> biginttype C = Absolute<number | bigint>;//=> number | bigint Copy
import type {Absolute} from 'type-fest';type A = Absolute<number>;//=> numbertype B = Absolute<bigint>;//=> biginttype C = Absolute<number | bigint>;//=> number | bigint
Returns the absolute value of the specified number or bigint.