@danielsimonjr/mathts-core 0.8.0 → 0.9.0

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.
@@ -2410,23 +2410,28 @@ var BigNumber = class _BigNumber {
2410
2410
  // ============================================================
2411
2411
  // Comparison Methods
2412
2412
  // ============================================================
2413
+ // All comparisons coerce their argument (number/string → BigNumber) exactly like the arithmetic
2414
+ // methods, so `bignumber(8).lessThanOrEqual(3)` behaves like `.add(3)` does. Without the
2415
+ // coercion the raw number reached the static comparator, which read `undefined._sign` and
2416
+ // returned garbage — silently breaking every factory-layer consumer that compares against a
2417
+ // number literal (isPrime, quantiles, …).
2413
2418
  equals(other) {
2414
- return _BigNumber.compare(this, other) === 0;
2419
+ return _BigNumber.compare(this, this.ensureBigNumber(other)) === 0;
2415
2420
  }
2416
2421
  lessThan(other) {
2417
- return _BigNumber.compare(this, other) < 0;
2422
+ return _BigNumber.compare(this, this.ensureBigNumber(other)) < 0;
2418
2423
  }
2419
2424
  lessThanOrEqual(other) {
2420
- return _BigNumber.compare(this, other) <= 0;
2425
+ return _BigNumber.compare(this, this.ensureBigNumber(other)) <= 0;
2421
2426
  }
2422
2427
  greaterThan(other) {
2423
- return _BigNumber.compare(this, other) > 0;
2428
+ return _BigNumber.compare(this, this.ensureBigNumber(other)) > 0;
2424
2429
  }
2425
2430
  greaterThanOrEqual(other) {
2426
- return _BigNumber.compare(this, other) >= 0;
2431
+ return _BigNumber.compare(this, this.ensureBigNumber(other)) >= 0;
2427
2432
  }
2428
2433
  compareTo(other) {
2429
- return _BigNumber.compare(this, other);
2434
+ return _BigNumber.compare(this, this.ensureBigNumber(other));
2430
2435
  }
2431
2436
  compare(other) {
2432
2437
  return this.compareTo(other);
@@ -2437,7 +2442,7 @@ var BigNumber = class _BigNumber {
2437
2442
  * Named `gt` for Decimal.js / mathjs formatter compatibility.
2438
2443
  */
2439
2444
  gt(other) {
2440
- return this.greaterThan(this.ensureBigNumber(other));
2445
+ return this.greaterThan(other);
2441
2446
  }
2442
2447
  // ============================================================
2443
2448
  // Rounding Methods
package/dist/index.d.ts CHANGED
@@ -1720,13 +1720,13 @@ declare class BigNumber implements MathTSValue {
1720
1720
  * Square root
1721
1721
  */
1722
1722
  sqrt(): BigNumber;
1723
- equals(other: BigNumber): boolean;
1724
- lessThan(other: BigNumber): boolean;
1725
- lessThanOrEqual(other: BigNumber): boolean;
1726
- greaterThan(other: BigNumber): boolean;
1727
- greaterThanOrEqual(other: BigNumber): boolean;
1728
- compareTo(other: BigNumber): number;
1729
- compare(other: BigNumber): number;
1723
+ equals(other: BigNumber | number | string): boolean;
1724
+ lessThan(other: BigNumber | number | string): boolean;
1725
+ lessThanOrEqual(other: BigNumber | number | string): boolean;
1726
+ greaterThan(other: BigNumber | number | string): boolean;
1727
+ greaterThanOrEqual(other: BigNumber | number | string): boolean;
1728
+ compareTo(other: BigNumber | number | string): number;
1729
+ compare(other: BigNumber | number | string): number;
1730
1730
  /**
1731
1731
  * Returns true iff this > other.
1732
1732
  * Accepts the same argument types as `add`/`multiply` (BigNumber, number, or string).
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
  round,
45
45
  sign,
46
46
  subtractScalar
47
- } from "./chunk-AMOHH5MP.js";
47
+ } from "./chunk-2WW76EEF.js";
48
48
 
49
49
  // src/types/matrix/Range.ts
50
50
  var name = "Range";
package/dist/internal.js CHANGED
@@ -69,7 +69,7 @@ import {
69
69
  typeOf,
70
70
  unitDependencies,
71
71
  warnOnce
72
- } from "./chunk-AMOHH5MP.js";
72
+ } from "./chunk-2WW76EEF.js";
73
73
  export {
74
74
  Unit as CoreUnit,
75
75
  acosh,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielsimonjr/mathts-core",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Core types, utilities, and configuration for MathTS",
5
5
  "author": "Daniel Simon Jr.",
6
6
  "license": "MIT",