@bignum/core
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -47,3 +47,2 @@ // src/options.mts | ||
e, | ||
hasRemainder: () => remainder > 0n, | ||
*digits(infinity) { | ||
@@ -58,10 +57,8 @@ remainder = initRemainder; | ||
) { | ||
for (let nn = 9n; nn > 0n; nn--) { | ||
const amount = d * nn * pow2; | ||
if (remainder < amount) | ||
continue; | ||
digit = nn; | ||
remainder -= amount; | ||
break; | ||
} | ||
let nn = 9n; | ||
let amount; | ||
while (remainder < (amount = d * nn * pow2)) | ||
nn--; | ||
digit = nn; | ||
remainder -= amount; | ||
} | ||
@@ -371,11 +368,9 @@ yield digit; | ||
) { | ||
for (let nn = 9n; nn > 0n; nn--) { | ||
const amount = (part + nn) * nn; | ||
if (remainder < amount) | ||
continue; | ||
numCtx.set(nn); | ||
remainder -= amount; | ||
part += nn * 2n; | ||
break; | ||
} | ||
let nn = 9n; | ||
let amount; | ||
while (remainder < (amount = (part + nn) * nn)) | ||
nn--; | ||
numCtx.set(nn); | ||
remainder -= amount; | ||
part += nn * 2n; | ||
} | ||
@@ -382,0 +377,0 @@ if (numCtx.overflow()) |
{ | ||
"name": "@bignum/core", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Arbitrary-precision decimal arithmetic with BigInt.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -17,3 +17,3 @@ # @bignum/core | ||
- It can handle very large and very small numbers. | ||
- <span class="minified-size"> 7.3 KB minified ([bignumber.js]: 18.2 KB) </span>. | ||
- <span class="minified-size"> 7.2 KB <!-- 7380 bytes --> minified ([bignumber.js]: 18.2 KB) </span>. | ||
- <span class="minified-and-gzipped-size"> 3.1 KB minified and gzipped ([bignumber.js]: 8.1 KB) </span>. | ||
@@ -194,3 +194,3 @@ | ||
It supports four arithmetic APIs and a basic API, which can be reduced to just <span class="bignum-basic-size"> 3.9 KB with tree shaking and minification (minified and gzipped: 1.6 KB) </span>.\ | ||
It supports four arithmetic APIs and a basic API, which can be reduced to just <span class="bignum-basic-size"> 3.8 KB <!-- 3931 bytes --> with tree shaking and minification (minified and gzipped: 1.6 KB) </span>.\ | ||
However, the API it provides is still experimental. | ||
@@ -197,0 +197,0 @@ |
Sorry, the diff of this file is not supported yet
52024
1455