@signpostmarv/intermediary-number 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/IntermediaryNumber.js +10 -0
- package/package.json +1 -1
|
@@ -18,6 +18,16 @@ function abs(value) {
|
|
|
18
18
|
: value);
|
|
19
19
|
}
|
|
20
20
|
function compare(value, to) {
|
|
21
|
+
if (value instanceof IntermediaryNumberInfinity
|
|
22
|
+
&& to instanceof IntermediaryNumberInfinity) {
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
else if (value instanceof IntermediaryNumberInfinity) {
|
|
26
|
+
return 1;
|
|
27
|
+
}
|
|
28
|
+
else if (to instanceof IntermediaryNumberInfinity) {
|
|
29
|
+
return -1;
|
|
30
|
+
}
|
|
21
31
|
const comparable = IntermediaryNumber.reuse_or_create(value).toBigNumberOrFraction();
|
|
22
32
|
let result;
|
|
23
33
|
if (comparable instanceof BigNumber) {
|
package/package.json
CHANGED