@danielsimonjr/mathts-core 0.2.0 → 0.3.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.
- package/dist/index.d.ts +31 -1
- package/dist/index.js +22 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -464,6 +464,36 @@ declare class Dual {
|
|
|
464
464
|
/** Type guard for {@link Dual}. */
|
|
465
465
|
declare function isDual(x: unknown): x is Dual;
|
|
466
466
|
|
|
467
|
+
/**
|
|
468
|
+
* Named mathematical constants (plain `number`).
|
|
469
|
+
*
|
|
470
|
+
* These mirror the constants documented in `docs/reference/constants.md` and the
|
|
471
|
+
* familiar `Math.*` values, exported as first-class named bindings so callers can
|
|
472
|
+
* `import { PI, E, TAU } from '@danielsimonjr/mathts-core'`. The imaginary unit
|
|
473
|
+
* `I` and the type-specific constants (`COMPLEX_*`, `BIGNUMBER_*`, `FRACTION_*`)
|
|
474
|
+
* live with their respective types.
|
|
475
|
+
*/
|
|
476
|
+
/** Ratio of a circle's circumference to its diameter. */
|
|
477
|
+
declare const PI: number;
|
|
478
|
+
/** Euler's number, the base of the natural logarithm. */
|
|
479
|
+
declare const E: number;
|
|
480
|
+
/** Full-circle constant, `2·PI`. */
|
|
481
|
+
declare const TAU: number;
|
|
482
|
+
/** Golden ratio, `(1 + √5) / 2`. */
|
|
483
|
+
declare const PHI: number;
|
|
484
|
+
/** Square root of 2. */
|
|
485
|
+
declare const SQRT2: number;
|
|
486
|
+
/** Square root of one-half. */
|
|
487
|
+
declare const SQRT1_2: number;
|
|
488
|
+
/** Natural logarithm of 2. */
|
|
489
|
+
declare const LN2: number;
|
|
490
|
+
/** Natural logarithm of 10. */
|
|
491
|
+
declare const LN10: number;
|
|
492
|
+
/** Base-2 logarithm of E. */
|
|
493
|
+
declare const LOG2E: number;
|
|
494
|
+
/** Base-10 logarithm of E. */
|
|
495
|
+
declare const LOG10E: number;
|
|
496
|
+
|
|
467
497
|
/**
|
|
468
498
|
* Fraction (rational number) implementation
|
|
469
499
|
* @module @danielsimonjr/mathts-core/types/fraction
|
|
@@ -1683,4 +1713,4 @@ declare const math: {
|
|
|
1683
1713
|
|
|
1684
1714
|
declare const VERSION = "0.1.0";
|
|
1685
1715
|
|
|
1686
|
-
export { ALL_UNITS, BASE_UNITS, BEST_PREFIXES, BIGNUMBER_E, BIGNUMBER_LN10, BIGNUMBER_LN2, BIGNUMBER_NEG_ONE, BIGNUMBER_ONE, BIGNUMBER_PI, BIGNUMBER_TEN, BIGNUMBER_ZERO, type BackendType, BigNumber, type BigNumberConfig, COMPLEX_NEG_ONE, COMPLEX_ONE, COMPLEX_ZERO, Complex, type ConversionDef, DEFAULT_CONFIG, DERIVED_UNITS, DIMENSIONLESS, DimensionMismatchError, type Dimensions, Dual, FRACTION_HALF, FRACTION_NEG_ONE, FRACTION_ONE, FRACTION_QUARTER, FRACTION_THIRD, FRACTION_ZERO, type FactoryDependencies, type FactoryFunction, type FactoryImport, Fraction, FunctionRegistry, I, type IBigNumber, type IComplex, type IFraction, type IMatrix, MATHTS_CONVERSIONS, MATHTS_TYPES, type MathTSConfig, type MathTSValue, type MatrixBackend, type MatrixDimensions, type NumericType, type RoundingMode, SI_PREFIXES, type Scalar, type TypeDef, TypeRegistry, UNIT_ALIASES, Unit, type UnitDef, UnitParseError, VERSION, createFactory, createMathTSTyped, createTypedFunction, dim, getPrefix, getUnitDef, initTypedWasm, isArray, isBigInt, isBigNumber, isBoolean, isComplex, isDenseMatrix, isDual, isFraction, isFunction, isMatrix, isNull, isNumber, isObject, isSparseMatrix, isString, isTypedWasmAvailable, isUndefined, isUnit, isUnit$1 as isUnitValue, math, mathTyped, registerNativeTypes, registry };
|
|
1716
|
+
export { ALL_UNITS, BASE_UNITS, BEST_PREFIXES, BIGNUMBER_E, BIGNUMBER_LN10, BIGNUMBER_LN2, BIGNUMBER_NEG_ONE, BIGNUMBER_ONE, BIGNUMBER_PI, BIGNUMBER_TEN, BIGNUMBER_ZERO, type BackendType, BigNumber, type BigNumberConfig, COMPLEX_NEG_ONE, COMPLEX_ONE, COMPLEX_ZERO, Complex, type ConversionDef, DEFAULT_CONFIG, DERIVED_UNITS, DIMENSIONLESS, DimensionMismatchError, type Dimensions, Dual, E, FRACTION_HALF, FRACTION_NEG_ONE, FRACTION_ONE, FRACTION_QUARTER, FRACTION_THIRD, FRACTION_ZERO, type FactoryDependencies, type FactoryFunction, type FactoryImport, Fraction, FunctionRegistry, I, type IBigNumber, type IComplex, type IFraction, type IMatrix, LN10, LN2, LOG10E, LOG2E, MATHTS_CONVERSIONS, MATHTS_TYPES, type MathTSConfig, type MathTSValue, type MatrixBackend, type MatrixDimensions, type NumericType, PHI, PI, type RoundingMode, SI_PREFIXES, SQRT1_2, SQRT2, type Scalar, TAU, type TypeDef, TypeRegistry, UNIT_ALIASES, Unit, type UnitDef, UnitParseError, VERSION, createFactory, createMathTSTyped, createTypedFunction, dim, getPrefix, getUnitDef, initTypedWasm, isArray, isBigInt, isBigNumber, isBoolean, isComplex, isDenseMatrix, isDual, isFraction, isFunction, isMatrix, isNull, isNumber, isObject, isSparseMatrix, isString, isTypedWasmAvailable, isUndefined, isUnit, isUnit$1 as isUnitValue, math, mathTyped, registerNativeTypes, registry };
|
package/dist/index.js
CHANGED
|
@@ -644,6 +644,18 @@ function isDual(x) {
|
|
|
644
644
|
return x instanceof Dual;
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
+
// src/constants.ts
|
|
648
|
+
var PI = Math.PI;
|
|
649
|
+
var E = Math.E;
|
|
650
|
+
var TAU = 2 * Math.PI;
|
|
651
|
+
var PHI = (1 + Math.sqrt(5)) / 2;
|
|
652
|
+
var SQRT2 = Math.SQRT2;
|
|
653
|
+
var SQRT1_2 = Math.SQRT1_2;
|
|
654
|
+
var LN2 = Math.LN2;
|
|
655
|
+
var LN10 = Math.LN10;
|
|
656
|
+
var LOG2E = Math.LOG2E;
|
|
657
|
+
var LOG10E = Math.LOG10E;
|
|
658
|
+
|
|
647
659
|
// src/types/fraction.ts
|
|
648
660
|
function isFraction(value) {
|
|
649
661
|
return value instanceof Fraction;
|
|
@@ -3501,6 +3513,7 @@ export {
|
|
|
3501
3513
|
DIMENSIONLESS,
|
|
3502
3514
|
DimensionMismatchError,
|
|
3503
3515
|
Dual,
|
|
3516
|
+
E,
|
|
3504
3517
|
FRACTION_HALF,
|
|
3505
3518
|
FRACTION_NEG_ONE,
|
|
3506
3519
|
FRACTION_ONE,
|
|
@@ -3510,9 +3523,18 @@ export {
|
|
|
3510
3523
|
Fraction,
|
|
3511
3524
|
FunctionRegistry,
|
|
3512
3525
|
I,
|
|
3526
|
+
LN10,
|
|
3527
|
+
LN2,
|
|
3528
|
+
LOG10E,
|
|
3529
|
+
LOG2E,
|
|
3513
3530
|
MATHTS_CONVERSIONS,
|
|
3514
3531
|
MATHTS_TYPES,
|
|
3532
|
+
PHI,
|
|
3533
|
+
PI,
|
|
3515
3534
|
SI_PREFIXES,
|
|
3535
|
+
SQRT1_2,
|
|
3536
|
+
SQRT2,
|
|
3537
|
+
TAU,
|
|
3516
3538
|
TypeRegistry,
|
|
3517
3539
|
UNIT_ALIASES,
|
|
3518
3540
|
Unit,
|