@numio/bigmath
Version:
@numio/bigmath is an arbitrary-precision arithmetic library. It can be used for basic operations with decimal numbers (integers and float)
19 lines (18 loc) • 839 B
JavaScript
import { bi2s, s2bi } from "../shared/utils.js";
import { fdrInner } from "./utils.js";
export const FDR = (array, options) => {
var _a, _b, _c;
const arrayInner = Array(array.length);
for (let i = 0; i < array.length; i++) {
arrayInner[i] = s2bi(array[i]);
}
const { binWidth, binNum } = fdrInner(arrayInner, {
useMadAbove: (_a = options === null || options === void 0 ? void 0 : options.useMadAbove) !== null && _a !== void 0 ? _a : 0,
maxBinNumber: (_b = options === null || options === void 0 ? void 0 : options.maxBinNumber) !== null && _b !== void 0 ? _b : 90,
madFrom: (_c = options === null || options === void 0 ? void 0 : options.madFrom) !== null && _c !== void 0 ? _c : "median",
});
return {
binNum: bi2s(binNum),
binWidth: bi2s(binWidth),
};
};