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)

13 lines (12 loc) 362 B
import { bi2s, s2bi } from "../shared/utils.js"; import { maxInner } from "./utils.js"; /** This function returns max value. */ export const max = (array) => { const arrayInner = Array(array.length); for (let i = 0; i < array.length; i++) { arrayInner[i] = s2bi(array[i]); } ; const bi = maxInner(arrayInner); return bi2s(bi); };