UNPKG

@numio/bigmath

Version:

@numio/bigmath is an arbitrary-precision arithmetic library. It can be used for basic operations with decimal numbers (integers and float)

8 lines (7 loc) 220 B
import { bi2s, s2bi } from "../shared/utils.js"; import { absInner } from "./utils.js"; /** Get absolute value of a number */ export const abs = (value) => { const bi = absInner(s2bi(value)); return bi2s(bi); };