@yaffle/bigdecimal
Advanced tools
Comparing version 1.0.19 to 1.0.20
@@ -549,3 +549,4 @@ /*jslint bigint: true, vars: true, indent: 2*/ | ||
const ten = BigDecimal.BigDecimal(10); | ||
let rounding = {maximumSignificantDigits: 8, roundingMode: "half-even"}; | ||
const minimumSignificantDigits = Math.pow(2, Math.ceil(Math.log2(bitLength(bigIntAbs(BigInt(value.exponent)) + 1n) / Math.log2(BASE)))) | ||
let rounding = {maximumSignificantDigits: Math.max(minimumSignificantDigits, 8), roundingMode: "half-even"}; | ||
let result = undefined; | ||
@@ -703,4 +704,4 @@ let fd = 0n; | ||
const v = Number(x.significand) * BASE**exponent; | ||
const numberValue = Math[name](v); | ||
if (name !== "sin" && name !== "cos" && name !== "tan" || Math.abs(numberValue) < Math.PI / 4) { | ||
if ((name !== "sin" && name !== "cos" && name !== "tan") || Math.abs(v) <= Math.PI / 4) { | ||
const numberValue = Math[name](v); | ||
const MIN_NORMALIZED_VALUE = (Number.MIN_VALUE * 1.25 > Number.MIN_VALUE ? Number.MIN_VALUE : Number.MIN_VALUE * (Number.MAX_SAFE_INTEGER + 1) / 2) || 2**-1022; | ||
@@ -934,2 +935,2 @@ const a = Math.abs(numberValue); | ||
export {BigDecimal, BigFloat} | ||
export {BigDecimal, BigFloat}; |
{ | ||
"name": "@yaffle/bigdecimal", | ||
"version": "1.0.19", | ||
"version": "1.0.20", | ||
"description": "Arbitrary precision decimal arithmetic library. Polyfill for decimal proposal. Implemented on the top of BigInt.", | ||
@@ -5,0 +5,0 @@ "main": "BigDecimal.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44418
899