@ac-kit/math-numbers 0.1.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/LICENSE +28 -0
- package/README.md +111 -0
- package/dist/decimal/_aligned-coefficients.d.ts +5 -0
- package/dist/decimal/_aligned-coefficients.d.ts.map +1 -0
- package/dist/decimal/_aligned-coefficients.js +15 -0
- package/dist/decimal/_aligned-coefficients.js.map +1 -0
- package/dist/decimal/_normalize.d.ts +7 -0
- package/dist/decimal/_normalize.d.ts.map +1 -0
- package/dist/decimal/_normalize.js +24 -0
- package/dist/decimal/_normalize.js.map +1 -0
- package/dist/decimal/_round.d.ts +10 -0
- package/dist/decimal/_round.d.ts.map +1 -0
- package/dist/decimal/_round.js +62 -0
- package/dist/decimal/_round.js.map +1 -0
- package/dist/decimal/decimal-abs.d.ts +4 -0
- package/dist/decimal/decimal-abs.d.ts.map +1 -0
- package/dist/decimal/decimal-abs.js +6 -0
- package/dist/decimal/decimal-abs.js.map +1 -0
- package/dist/decimal/decimal-add.d.ts +4 -0
- package/dist/decimal/decimal-add.d.ts.map +1 -0
- package/dist/decimal/decimal-add.js +9 -0
- package/dist/decimal/decimal-add.js.map +1 -0
- package/dist/decimal/decimal-compare.d.ts +5 -0
- package/dist/decimal/decimal-compare.d.ts.map +1 -0
- package/dist/decimal/decimal-compare.js +10 -0
- package/dist/decimal/decimal-compare.js.map +1 -0
- package/dist/decimal/decimal-digit-at.d.ts +15 -0
- package/dist/decimal/decimal-digit-at.d.ts.map +1 -0
- package/dist/decimal/decimal-digit-at.js +26 -0
- package/dist/decimal/decimal-digit-at.js.map +1 -0
- package/dist/decimal/decimal-div.d.ts +13 -0
- package/dist/decimal/decimal-div.d.ts.map +1 -0
- package/dist/decimal/decimal-div.js +41 -0
- package/dist/decimal/decimal-div.js.map +1 -0
- package/dist/decimal/decimal-fractional-precision.d.ts +12 -0
- package/dist/decimal/decimal-fractional-precision.d.ts.map +1 -0
- package/dist/decimal/decimal-fractional-precision.js +13 -0
- package/dist/decimal/decimal-fractional-precision.js.map +1 -0
- package/dist/decimal/decimal-from-big-int.d.ts +8 -0
- package/dist/decimal/decimal-from-big-int.d.ts.map +1 -0
- package/dist/decimal/decimal-from-big-int.js +10 -0
- package/dist/decimal/decimal-from-big-int.js.map +1 -0
- package/dist/decimal/decimal-from-number.d.ts +8 -0
- package/dist/decimal/decimal-from-number.d.ts.map +1 -0
- package/dist/decimal/decimal-from-number.js +17 -0
- package/dist/decimal/decimal-from-number.js.map +1 -0
- package/dist/decimal/decimal-from-string.d.ts +8 -0
- package/dist/decimal/decimal-from-string.d.ts.map +1 -0
- package/dist/decimal/decimal-from-string.js +33 -0
- package/dist/decimal/decimal-from-string.js.map +1 -0
- package/dist/decimal/decimal-integral-fractional.d.ts +12 -0
- package/dist/decimal/decimal-integral-fractional.d.ts.map +1 -0
- package/dist/decimal/decimal-integral-fractional.js +31 -0
- package/dist/decimal/decimal-integral-fractional.js.map +1 -0
- package/dist/decimal/decimal-integral-precision.d.ts +10 -0
- package/dist/decimal/decimal-integral-precision.d.ts.map +1 -0
- package/dist/decimal/decimal-integral-precision.js +12 -0
- package/dist/decimal/decimal-integral-precision.js.map +1 -0
- package/dist/decimal/decimal-inv.d.ts +4 -0
- package/dist/decimal/decimal-inv.d.ts.map +1 -0
- package/dist/decimal/decimal-inv.js +7 -0
- package/dist/decimal/decimal-inv.js.map +1 -0
- package/dist/decimal/decimal-is-equal.d.ts +4 -0
- package/dist/decimal/decimal-is-equal.d.ts.map +1 -0
- package/dist/decimal/decimal-is-equal.js +6 -0
- package/dist/decimal/decimal-is-equal.js.map +1 -0
- package/dist/decimal/decimal-mul.d.ts +4 -0
- package/dist/decimal/decimal-mul.d.ts.map +1 -0
- package/dist/decimal/decimal-mul.js +7 -0
- package/dist/decimal/decimal-mul.js.map +1 -0
- package/dist/decimal/decimal-neg.d.ts +4 -0
- package/dist/decimal/decimal-neg.d.ts.map +1 -0
- package/dist/decimal/decimal-neg.js +9 -0
- package/dist/decimal/decimal-neg.js.map +1 -0
- package/dist/decimal/decimal-round-to-context.d.ts +9 -0
- package/dist/decimal/decimal-round-to-context.d.ts.map +1 -0
- package/dist/decimal/decimal-round-to-context.js +22 -0
- package/dist/decimal/decimal-round-to-context.js.map +1 -0
- package/dist/decimal/decimal-round-to-place.d.ts +20 -0
- package/dist/decimal/decimal-round-to-place.d.ts.map +1 -0
- package/dist/decimal/decimal-round-to-place.js +32 -0
- package/dist/decimal/decimal-round-to-place.js.map +1 -0
- package/dist/decimal/decimal-sign.d.ts +5 -0
- package/dist/decimal/decimal-sign.d.ts.map +1 -0
- package/dist/decimal/decimal-sign.js +8 -0
- package/dist/decimal/decimal-sign.js.map +1 -0
- package/dist/decimal/decimal-sqrt.d.ts +11 -0
- package/dist/decimal/decimal-sqrt.d.ts.map +1 -0
- package/dist/decimal/decimal-sqrt.js +42 -0
- package/dist/decimal/decimal-sqrt.js.map +1 -0
- package/dist/decimal/decimal-sub.d.ts +4 -0
- package/dist/decimal/decimal-sub.d.ts.map +1 -0
- package/dist/decimal/decimal-sub.js +7 -0
- package/dist/decimal/decimal-sub.js.map +1 -0
- package/dist/decimal/decimal-to-exponential.d.ts +18 -0
- package/dist/decimal/decimal-to-exponential.d.ts.map +1 -0
- package/dist/decimal/decimal-to-exponential.js +41 -0
- package/dist/decimal/decimal-to-exponential.js.map +1 -0
- package/dist/decimal/decimal-to-fixed.d.ts +20 -0
- package/dist/decimal/decimal-to-fixed.d.ts.map +1 -0
- package/dist/decimal/decimal-to-fixed.js +39 -0
- package/dist/decimal/decimal-to-fixed.js.map +1 -0
- package/dist/decimal/decimal-to-number.d.ts +4 -0
- package/dist/decimal/decimal-to-number.d.ts.map +1 -0
- package/dist/decimal/decimal-to-number.js +5 -0
- package/dist/decimal/decimal-to-number.js.map +1 -0
- package/dist/decimal/decimal-to-precision.d.ts +19 -0
- package/dist/decimal/decimal-to-precision.d.ts.map +1 -0
- package/dist/decimal/decimal-to-precision.js +35 -0
- package/dist/decimal/decimal-to-precision.js.map +1 -0
- package/dist/decimal/decimal-to-string.d.ts +28 -0
- package/dist/decimal/decimal-to-string.d.ts.map +1 -0
- package/dist/decimal/decimal-to-string.js +64 -0
- package/dist/decimal/decimal-to-string.js.map +1 -0
- package/dist/decimal/decimal-types.d.ts +54 -0
- package/dist/decimal/decimal-types.d.ts.map +1 -0
- package/dist/decimal/decimal-types.js +45 -0
- package/dist/decimal/decimal-types.js.map +1 -0
- package/dist/format-numeral.d.ts +42 -0
- package/dist/format-numeral.d.ts.map +1 -0
- package/dist/format-numeral.js +80 -0
- package/dist/format-numeral.js.map +1 -0
- package/dist/globals.d.ts +38 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +22 -0
- package/dist/globals.js.map +1 -0
- package/dist/ieee754/binary/_all-ones-exp.d.ts +4 -0
- package/dist/ieee754/binary/_all-ones-exp.d.ts.map +1 -0
- package/dist/ieee754/binary/_all-ones-exp.js +6 -0
- package/dist/ieee754/binary/_all-ones-exp.js.map +1 -0
- package/dist/ieee754/binary/_bias.d.ts +7 -0
- package/dist/ieee754/binary/_bias.d.ts.map +1 -0
- package/dist/ieee754/binary/_bias.js +8 -0
- package/dist/ieee754/binary/_bias.js.map +1 -0
- package/dist/ieee754/binary/_encode-big-int.d.ts +11 -0
- package/dist/ieee754/binary/_encode-big-int.d.ts.map +1 -0
- package/dist/ieee754/binary/_encode-big-int.js +28 -0
- package/dist/ieee754/binary/_encode-big-int.js.map +1 -0
- package/dist/ieee754/binary/_encode-exp-sign.d.ts +11 -0
- package/dist/ieee754/binary/_encode-exp-sign.d.ts.map +1 -0
- package/dist/ieee754/binary/_encode-exp-sign.js +32 -0
- package/dist/ieee754/binary/_encode-exp-sign.js.map +1 -0
- package/dist/ieee754/binary/_encode-limbs.d.ts +8 -0
- package/dist/ieee754/binary/_encode-limbs.d.ts.map +1 -0
- package/dist/ieee754/binary/_encode-limbs.js +21 -0
- package/dist/ieee754/binary/_encode-limbs.js.map +1 -0
- package/dist/ieee754/binary/_exponent-width.d.ts +9 -0
- package/dist/ieee754/binary/_exponent-width.d.ts.map +1 -0
- package/dist/ieee754/binary/_exponent-width.js +10 -0
- package/dist/ieee754/binary/_exponent-width.js.map +1 -0
- package/dist/ieee754/binary/_finite-or-special.d.ts +8 -0
- package/dist/ieee754/binary/_finite-or-special.d.ts.map +1 -0
- package/dist/ieee754/binary/_finite-or-special.js +17 -0
- package/dist/ieee754/binary/_finite-or-special.js.map +1 -0
- package/dist/ieee754/binary/_finite-to-big-int.d.ts +8 -0
- package/dist/ieee754/binary/_finite-to-big-int.d.ts.map +1 -0
- package/dist/ieee754/binary/_finite-to-big-int.js +13 -0
- package/dist/ieee754/binary/_finite-to-big-int.js.map +1 -0
- package/dist/ieee754/binary/_finite-to-limbs.d.ts +7 -0
- package/dist/ieee754/binary/_finite-to-limbs.d.ts.map +1 -0
- package/dist/ieee754/binary/_finite-to-limbs.js +12 -0
- package/dist/ieee754/binary/_finite-to-limbs.js.map +1 -0
- package/dist/ieee754/binary/_get-biased-exp.d.ts +13 -0
- package/dist/ieee754/binary/_get-biased-exp.d.ts.map +1 -0
- package/dist/ieee754/binary/_get-biased-exp.js +26 -0
- package/dist/ieee754/binary/_get-biased-exp.js.map +1 -0
- package/dist/ieee754/binary/_get-sign.d.ts +5 -0
- package/dist/ieee754/binary/_get-sign.d.ts.map +1 -0
- package/dist/ieee754/binary/_get-sign.js +6 -0
- package/dist/ieee754/binary/_get-sign.js.map +1 -0
- package/dist/ieee754/binary/_get-trailing-sig-big-int.d.ts +9 -0
- package/dist/ieee754/binary/_get-trailing-sig-big-int.d.ts.map +1 -0
- package/dist/ieee754/binary/_get-trailing-sig-big-int.js +24 -0
- package/dist/ieee754/binary/_get-trailing-sig-big-int.js.map +1 -0
- package/dist/ieee754/binary/_get-trailing-sig-limbs.d.ts +9 -0
- package/dist/ieee754/binary/_get-trailing-sig-limbs.d.ts.map +1 -0
- package/dist/ieee754/binary/_get-trailing-sig-limbs.js +22 -0
- package/dist/ieee754/binary/_get-trailing-sig-limbs.js.map +1 -0
- package/dist/ieee754/binary/_narrow-to-big-int.d.ts +7 -0
- package/dist/ieee754/binary/_narrow-to-big-int.d.ts.map +1 -0
- package/dist/ieee754/binary/_narrow-to-big-int.js +9 -0
- package/dist/ieee754/binary/_narrow-to-big-int.js.map +1 -0
- package/dist/ieee754/binary/_normalize.d.ts +47 -0
- package/dist/ieee754/binary/_normalize.d.ts.map +1 -0
- package/dist/ieee754/binary/_normalize.js +105 -0
- package/dist/ieee754/binary/_normalize.js.map +1 -0
- package/dist/ieee754/binary/_pack-from-big-int.d.ts +13 -0
- package/dist/ieee754/binary/_pack-from-big-int.d.ts.map +1 -0
- package/dist/ieee754/binary/_pack-from-big-int.js +68 -0
- package/dist/ieee754/binary/_pack-from-big-int.js.map +1 -0
- package/dist/ieee754/binary/_pack-from-limbs.d.ts +9 -0
- package/dist/ieee754/binary/_pack-from-limbs.d.ts.map +1 -0
- package/dist/ieee754/binary/_pack-from-limbs.js +67 -0
- package/dist/ieee754/binary/_pack-from-limbs.js.map +1 -0
- package/dist/ieee754/binary/_to-format.d.ts +12 -0
- package/dist/ieee754/binary/_to-format.d.ts.map +1 -0
- package/dist/ieee754/binary/_to-format.js +20 -0
- package/dist/ieee754/binary/_to-format.js.map +1 -0
- package/dist/ieee754/binary/_trailing-width.d.ts +7 -0
- package/dist/ieee754/binary/_trailing-width.d.ts.map +1 -0
- package/dist/ieee754/binary/_trailing-width.js +8 -0
- package/dist/ieee754/binary/_trailing-width.js.map +1 -0
- package/dist/ieee754/binary/_unpack-to-big-int.d.ts +21 -0
- package/dist/ieee754/binary/_unpack-to-big-int.d.ts.map +1 -0
- package/dist/ieee754/binary/_unpack-to-big-int.js +56 -0
- package/dist/ieee754/binary/_unpack-to-big-int.js.map +1 -0
- package/dist/ieee754/binary/_unpack-to-limbs.d.ts +10 -0
- package/dist/ieee754/binary/_unpack-to-limbs.d.ts.map +1 -0
- package/dist/ieee754/binary/_unpack-to-limbs.js +46 -0
- package/dist/ieee754/binary/_unpack-to-limbs.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-abs.d.ts +4 -0
- package/dist/ieee754/binary/ieee-binary-abs.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-abs.js +9 -0
- package/dist/ieee754/binary/ieee-binary-abs.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-add.d.ts +10 -0
- package/dist/ieee754/binary/ieee-binary-add.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-add.js +125 -0
- package/dist/ieee754/binary/ieee-binary-add.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-cmp.d.ts +10 -0
- package/dist/ieee754/binary/ieee-binary-cmp.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-cmp.js +44 -0
- package/dist/ieee754/binary/ieee-binary-cmp.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-from-decimal.d.ts +19 -0
- package/dist/ieee754/binary/ieee-binary-from-decimal.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-from-decimal.js +39 -0
- package/dist/ieee754/binary/ieee-binary-from-decimal.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-from-number.d.ts +10 -0
- package/dist/ieee754/binary/ieee-binary-from-number.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-from-number.js +23 -0
- package/dist/ieee754/binary/ieee-binary-from-number.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-is-finite.d.ts +11 -0
- package/dist/ieee754/binary/ieee-binary-is-finite.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-is-finite.js +12 -0
- package/dist/ieee754/binary/ieee-binary-is-finite.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-is-infinite.d.ts +9 -0
- package/dist/ieee754/binary/ieee-binary-is-infinite.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-is-infinite.js +10 -0
- package/dist/ieee754/binary/ieee-binary-is-infinite.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-is-nan.d.ts +12 -0
- package/dist/ieee754/binary/ieee-binary-is-nan.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-is-nan.js +13 -0
- package/dist/ieee754/binary/ieee-binary-is-nan.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-neg.d.ts +4 -0
- package/dist/ieee754/binary/ieee-binary-neg.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-neg.js +10 -0
- package/dist/ieee754/binary/ieee-binary-neg.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-normalize.d.ts +13 -0
- package/dist/ieee754/binary/ieee-binary-normalize.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-normalize.js +14 -0
- package/dist/ieee754/binary/ieee-binary-normalize.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-sign.d.ts +19 -0
- package/dist/ieee754/binary/ieee-binary-sign.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-sign.js +25 -0
- package/dist/ieee754/binary/ieee-binary-sign.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-sqrt.d.ts +17 -0
- package/dist/ieee754/binary/ieee-binary-sqrt.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-sqrt.js +56 -0
- package/dist/ieee754/binary/ieee-binary-sqrt.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-sub.d.ts +5 -0
- package/dist/ieee754/binary/ieee-binary-sub.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-sub.js +7 -0
- package/dist/ieee754/binary/ieee-binary-sub.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-to-decimal.d.ts +21 -0
- package/dist/ieee754/binary/ieee-binary-to-decimal.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-to-decimal.js +28 -0
- package/dist/ieee754/binary/ieee-binary-to-decimal.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-to-number.d.ts +14 -0
- package/dist/ieee754/binary/ieee-binary-to-number.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-to-number.js +30 -0
- package/dist/ieee754/binary/ieee-binary-to-number.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-to-shortest-decimal.d.ts +34 -0
- package/dist/ieee754/binary/ieee-binary-to-shortest-decimal.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-to-shortest-decimal.js +108 -0
- package/dist/ieee754/binary/ieee-binary-to-shortest-decimal.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-to-string.d.ts +25 -0
- package/dist/ieee754/binary/ieee-binary-to-string.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-to-string.js +48 -0
- package/dist/ieee754/binary/ieee-binary-to-string.js.map +1 -0
- package/dist/ieee754/binary/ieee-binary-types.d.ts +39 -0
- package/dist/ieee754/binary/ieee-binary-types.d.ts.map +1 -0
- package/dist/ieee754/binary/ieee-binary-types.js +6 -0
- package/dist/ieee754/binary/ieee-binary-types.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_axpby-batch.d.ts +4 -0
- package/dist/ieee754/binary/kernels/fallback/_axpby-batch.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_axpby-batch.js +11 -0
- package/dist/ieee754/binary/kernels/fallback/_axpby-batch.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_axpby.d.ts +8 -0
- package/dist/ieee754/binary/kernels/fallback/_axpby.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_axpby.js +10 -0
- package/dist/ieee754/binary/kernels/fallback/_axpby.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_axpy-batch.d.ts +4 -0
- package/dist/ieee754/binary/kernels/fallback/_axpy-batch.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_axpy-batch.js +10 -0
- package/dist/ieee754/binary/kernels/fallback/_axpy-batch.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_axpy.d.ts +8 -0
- package/dist/ieee754/binary/kernels/fallback/_axpy.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_axpy.js +10 -0
- package/dist/ieee754/binary/kernels/fallback/_axpy.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_batch-element.d.ts +13 -0
- package/dist/ieee754/binary/kernels/fallback/_batch-element.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_batch-element.js +22 -0
- package/dist/ieee754/binary/kernels/fallback/_batch-element.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_div-batch.d.ts +4 -0
- package/dist/ieee754/binary/kernels/fallback/_div-batch.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_div-batch.js +9 -0
- package/dist/ieee754/binary/kernels/fallback/_div-batch.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_div.d.ts +11 -0
- package/dist/ieee754/binary/kernels/fallback/_div.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_div.js +46 -0
- package/dist/ieee754/binary/kernels/fallback/_div.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_mul-batch.d.ts +7 -0
- package/dist/ieee754/binary/kernels/fallback/_mul-batch.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_mul-batch.js +12 -0
- package/dist/ieee754/binary/kernels/fallback/_mul-batch.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_mul.d.ts +11 -0
- package/dist/ieee754/binary/kernels/fallback/_mul.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/_mul.js +38 -0
- package/dist/ieee754/binary/kernels/fallback/_mul.js.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/fallback-kernel.d.ts +24 -0
- package/dist/ieee754/binary/kernels/fallback/fallback-kernel.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/fallback/fallback-kernel.js +23 -0
- package/dist/ieee754/binary/kernels/fallback/fallback-kernel.js.map +1 -0
- package/dist/ieee754/binary/kernels/kernel.d.ts +20 -0
- package/dist/ieee754/binary/kernels/kernel.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/kernel.js +30 -0
- package/dist/ieee754/binary/kernels/kernel.js.map +1 -0
- package/dist/ieee754/binary/kernels/types.d.ts +63 -0
- package/dist/ieee754/binary/kernels/types.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/types.js +2 -0
- package/dist/ieee754/binary/kernels/types.js.map +1 -0
- package/dist/ieee754/binary/kernels/wasm/_wasm-bytes.generated.d.ts +3 -0
- package/dist/ieee754/binary/kernels/wasm/_wasm-bytes.generated.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/wasm/_wasm-bytes.generated.js +3 -0
- package/dist/ieee754/binary/kernels/wasm/_wasm-bytes.generated.js.map +1 -0
- package/dist/ieee754/binary/kernels/wasm/wasm-kernel.d.ts +29 -0
- package/dist/ieee754/binary/kernels/wasm/wasm-kernel.d.ts.map +1 -0
- package/dist/ieee754/binary/kernels/wasm/wasm-kernel.js +91 -0
- package/dist/ieee754/binary/kernels/wasm/wasm-kernel.js.map +1 -0
- package/dist/ieee754/common/_neg-sign.d.ts +4 -0
- package/dist/ieee754/common/_neg-sign.d.ts.map +1 -0
- package/dist/ieee754/common/_neg-sign.js +5 -0
- package/dist/ieee754/common/_neg-sign.js.map +1 -0
- package/dist/ieee754/common/ieee-sign.d.ts +2 -0
- package/dist/ieee754/common/ieee-sign.d.ts.map +1 -0
- package/dist/ieee754/common/ieee-sign.js +2 -0
- package/dist/ieee754/common/ieee-sign.js.map +1 -0
- package/dist/ieee754/decimal/ieee-decimal-types.d.ts +33 -0
- package/dist/ieee754/decimal/ieee-decimal-types.d.ts.map +1 -0
- package/dist/ieee754/decimal/ieee-decimal-types.js +2 -0
- package/dist/ieee754/decimal/ieee-decimal-types.js.map +1 -0
- package/dist/ieee754/ieee-format.d.ts +30 -0
- package/dist/ieee754/ieee-format.d.ts.map +1 -0
- package/dist/ieee754/ieee-format.js +59 -0
- package/dist/ieee754/ieee-format.js.map +1 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/integral-fractional.d.ts +83 -0
- package/dist/integral-fractional.d.ts.map +1 -0
- package/dist/integral-fractional.js +112 -0
- package/dist/integral-fractional.js.map +1 -0
- package/dist/num/_binary-fp-base.d.ts +49 -0
- package/dist/num/_binary-fp-base.d.ts.map +1 -0
- package/dist/num/_binary-fp-base.js +26 -0
- package/dist/num/_binary-fp-base.js.map +1 -0
- package/dist/num/_factory.d.ts +23 -0
- package/dist/num/_factory.d.ts.map +1 -0
- package/dist/num/_factory.js +36 -0
- package/dist/num/_factory.js.map +1 -0
- package/dist/num/_promote.d.ts +26 -0
- package/dist/num/_promote.d.ts.map +1 -0
- package/dist/num/_promote.js +38 -0
- package/dist/num/_promote.js.map +1 -0
- package/dist/num/_special-value.d.ts +76 -0
- package/dist/num/_special-value.d.ts.map +1 -0
- package/dist/num/_special-value.js +108 -0
- package/dist/num/_special-value.js.map +1 -0
- package/dist/num/binary-fp.d.ts +135 -0
- package/dist/num/binary-fp.d.ts.map +1 -0
- package/dist/num/binary-fp.js +330 -0
- package/dist/num/binary-fp.js.map +1 -0
- package/dist/num/binary-fp128.d.ts +143 -0
- package/dist/num/binary-fp128.d.ts.map +1 -0
- package/dist/num/binary-fp128.js +265 -0
- package/dist/num/binary-fp128.js.map +1 -0
- package/dist/num/binary-fp16.d.ts +131 -0
- package/dist/num/binary-fp16.d.ts.map +1 -0
- package/dist/num/binary-fp16.js +262 -0
- package/dist/num/binary-fp16.js.map +1 -0
- package/dist/num/binary-fp32.d.ts +131 -0
- package/dist/num/binary-fp32.d.ts.map +1 -0
- package/dist/num/binary-fp32.js +254 -0
- package/dist/num/binary-fp32.js.map +1 -0
- package/dist/num/binary-fp64.d.ts +140 -0
- package/dist/num/binary-fp64.d.ts.map +1 -0
- package/dist/num/binary-fp64.js +262 -0
- package/dist/num/binary-fp64.js.map +1 -0
- package/dist/num/decimal-num.d.ts +149 -0
- package/dist/num/decimal-num.d.ts.map +1 -0
- package/dist/num/decimal-num.js +275 -0
- package/dist/num/decimal-num.js.map +1 -0
- package/dist/num/fraction.d.ts +138 -0
- package/dist/num/fraction.d.ts.map +1 -0
- package/dist/num/fraction.js +299 -0
- package/dist/num/fraction.js.map +1 -0
- package/dist/num/ibitwise.d.ts +23 -0
- package/dist/num/ibitwise.d.ts.map +1 -0
- package/dist/num/ibitwise.js +2 -0
- package/dist/num/ibitwise.js.map +1 -0
- package/dist/num/integer-num.d.ts +268 -0
- package/dist/num/integer-num.d.ts.map +1 -0
- package/dist/num/integer-num.js +471 -0
- package/dist/num/integer-num.js.map +1 -0
- package/dist/num/inum.d.ts +125 -0
- package/dist/num/inum.d.ts.map +1 -0
- package/dist/num/inum.js +2 -0
- package/dist/num/inum.js.map +1 -0
- package/dist/overflow-mode.d.ts +17 -0
- package/dist/overflow-mode.d.ts.map +1 -0
- package/dist/overflow-mode.js +8 -0
- package/dist/overflow-mode.js.map +1 -0
- package/dist/precision-kind.d.ts +85 -0
- package/dist/precision-kind.d.ts.map +1 -0
- package/dist/precision-kind.js +9 -0
- package/dist/precision-kind.js.map +1 -0
- package/dist/rational/rational-abs.d.ts +4 -0
- package/dist/rational/rational-abs.d.ts.map +1 -0
- package/dist/rational/rational-abs.js +6 -0
- package/dist/rational/rational-abs.js.map +1 -0
- package/dist/rational/rational-add.d.ts +10 -0
- package/dist/rational/rational-add.d.ts.map +1 -0
- package/dist/rational/rational-add.js +28 -0
- package/dist/rational/rational-add.js.map +1 -0
- package/dist/rational/rational-compare.d.ts +10 -0
- package/dist/rational/rational-compare.d.ts.map +1 -0
- package/dist/rational/rational-compare.js +15 -0
- package/dist/rational/rational-compare.js.map +1 -0
- package/dist/rational/rational-decimal-precision.d.ts +10 -0
- package/dist/rational/rational-decimal-precision.d.ts.map +1 -0
- package/dist/rational/rational-decimal-precision.js +18 -0
- package/dist/rational/rational-decimal-precision.js.map +1 -0
- package/dist/rational/rational-div.d.ts +8 -0
- package/dist/rational/rational-div.d.ts.map +1 -0
- package/dist/rational/rational-div.js +11 -0
- package/dist/rational/rational-div.js.map +1 -0
- package/dist/rational/rational-format.d.ts +21 -0
- package/dist/rational/rational-format.d.ts.map +1 -0
- package/dist/rational/rational-format.js +36 -0
- package/dist/rational/rational-format.js.map +1 -0
- package/dist/rational/rational-fractional-precision.d.ts +16 -0
- package/dist/rational/rational-fractional-precision.d.ts.map +1 -0
- package/dist/rational/rational-fractional-precision.js +37 -0
- package/dist/rational/rational-fractional-precision.js.map +1 -0
- package/dist/rational/rational-from-number.d.ts +10 -0
- package/dist/rational/rational-from-number.d.ts.map +1 -0
- package/dist/rational/rational-from-number.js +51 -0
- package/dist/rational/rational-from-number.js.map +1 -0
- package/dist/rational/rational-integral-fractional.d.ts +10 -0
- package/dist/rational/rational-integral-fractional.d.ts.map +1 -0
- package/dist/rational/rational-integral-fractional.js +16 -0
- package/dist/rational/rational-integral-fractional.js.map +1 -0
- package/dist/rational/rational-inv.d.ts +8 -0
- package/dist/rational/rational-inv.d.ts.map +1 -0
- package/dist/rational/rational-inv.js +23 -0
- package/dist/rational/rational-inv.js.map +1 -0
- package/dist/rational/rational-is-equal.d.ts +4 -0
- package/dist/rational/rational-is-equal.d.ts.map +1 -0
- package/dist/rational/rational-is-equal.js +6 -0
- package/dist/rational/rational-is-equal.js.map +1 -0
- package/dist/rational/rational-mul.d.ts +9 -0
- package/dist/rational/rational-mul.d.ts.map +1 -0
- package/dist/rational/rational-mul.js +24 -0
- package/dist/rational/rational-mul.js.map +1 -0
- package/dist/rational/rational-neg.d.ts +4 -0
- package/dist/rational/rational-neg.d.ts.map +1 -0
- package/dist/rational/rational-neg.js +5 -0
- package/dist/rational/rational-neg.js.map +1 -0
- package/dist/rational/rational-normalize.d.ts +13 -0
- package/dist/rational/rational-normalize.d.ts.map +1 -0
- package/dist/rational/rational-normalize.js +24 -0
- package/dist/rational/rational-normalize.js.map +1 -0
- package/dist/rational/rational-reduce.d.ts +4 -0
- package/dist/rational/rational-reduce.d.ts.map +1 -0
- package/dist/rational/rational-reduce.js +17 -0
- package/dist/rational/rational-reduce.js.map +1 -0
- package/dist/rational/rational-sign.d.ts +5 -0
- package/dist/rational/rational-sign.d.ts.map +1 -0
- package/dist/rational/rational-sign.js +8 -0
- package/dist/rational/rational-sign.js.map +1 -0
- package/dist/rational/rational-sqrt-exact.d.ts +10 -0
- package/dist/rational/rational-sqrt-exact.d.ts.map +1 -0
- package/dist/rational/rational-sqrt-exact.js +22 -0
- package/dist/rational/rational-sqrt-exact.js.map +1 -0
- package/dist/rational/rational-sub.d.ts +4 -0
- package/dist/rational/rational-sub.d.ts.map +1 -0
- package/dist/rational/rational-sub.js +7 -0
- package/dist/rational/rational-sub.js.map +1 -0
- package/dist/rational/rational-to-decimal-string.d.ts +21 -0
- package/dist/rational/rational-to-decimal-string.d.ts.map +1 -0
- package/dist/rational/rational-to-decimal-string.js +39 -0
- package/dist/rational/rational-to-decimal-string.js.map +1 -0
- package/dist/rational/rational-to-number.d.ts +10 -0
- package/dist/rational/rational-to-number.d.ts.map +1 -0
- package/dist/rational/rational-to-number.js +25 -0
- package/dist/rational/rational-to-number.js.map +1 -0
- package/dist/rational/rational-to-string.d.ts +10 -0
- package/dist/rational/rational-to-string.d.ts.map +1 -0
- package/dist/rational/rational-to-string.js +14 -0
- package/dist/rational/rational-to-string.js.map +1 -0
- package/dist/rational/rational-types.d.ts +26 -0
- package/dist/rational/rational-types.d.ts.map +1 -0
- package/dist/rational/rational-types.js +13 -0
- package/dist/rational/rational-types.js.map +1 -0
- package/dist/refill-locale-skeleton.d.ts +25 -0
- package/dist/refill-locale-skeleton.d.ts.map +1 -0
- package/dist/refill-locale-skeleton.js +62 -0
- package/dist/refill-locale-skeleton.js.map +1 -0
- package/dist/resolve-locale-skeleton.d.ts +55 -0
- package/dist/resolve-locale-skeleton.d.ts.map +1 -0
- package/dist/resolve-locale-skeleton.js +105 -0
- package/dist/resolve-locale-skeleton.js.map +1 -0
- package/dist/rounding-mode-from-intl.d.ts +15 -0
- package/dist/rounding-mode-from-intl.d.ts.map +1 -0
- package/dist/rounding-mode-from-intl.js +28 -0
- package/dist/rounding-mode-from-intl.js.map +1 -0
- package/dist/rounding-mode.d.ts +48 -0
- package/dist/rounding-mode.d.ts.map +1 -0
- package/dist/rounding-mode.js +6 -0
- package/dist/rounding-mode.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { ORDERED_FIELD, OrderedBase, } from "@ac-kit/math-algebra";
|
|
2
|
+
import { decimalFromString } from "../decimal/decimal-from-string.js";
|
|
3
|
+
import { decimalToExponential } from "../decimal/decimal-to-exponential.js";
|
|
4
|
+
import { decimalToFixed } from "../decimal/decimal-to-fixed.js";
|
|
5
|
+
import { decimalToPrecision } from "../decimal/decimal-to-precision.js";
|
|
6
|
+
import { rationalAbs } from "../rational/rational-abs.js";
|
|
7
|
+
import { rationalAdd } from "../rational/rational-add.js";
|
|
8
|
+
import { rationalCompare } from "../rational/rational-compare.js";
|
|
9
|
+
import { rationalDecimalPrecision } from "../rational/rational-decimal-precision.js";
|
|
10
|
+
import { rationalDiv } from "../rational/rational-div.js";
|
|
11
|
+
import { rationalFormat } from "../rational/rational-format.js";
|
|
12
|
+
import { rationalFractionalPrecision } from "../rational/rational-fractional-precision.js";
|
|
13
|
+
import { rationalIntegralFractional } from "../rational/rational-integral-fractional.js";
|
|
14
|
+
import { rationalInv } from "../rational/rational-inv.js";
|
|
15
|
+
import { rationalMul } from "../rational/rational-mul.js";
|
|
16
|
+
import { rationalNeg } from "../rational/rational-neg.js";
|
|
17
|
+
import { rationalNormalize } from "../rational/rational-normalize.js";
|
|
18
|
+
import { rationalReduce } from "../rational/rational-reduce.js";
|
|
19
|
+
import { rationalSign } from "../rational/rational-sign.js";
|
|
20
|
+
import { rationalSqrtExact } from "../rational/rational-sqrt-exact.js";
|
|
21
|
+
import { rationalSub } from "../rational/rational-sub.js";
|
|
22
|
+
import { rationalToDecimalString } from "../rational/rational-to-decimal-string.js";
|
|
23
|
+
import { rationalToNumber } from "../rational/rational-to-number.js";
|
|
24
|
+
import { rationalToString } from "../rational/rational-to-string.js";
|
|
25
|
+
import { RATIONAL_ONE, RATIONAL_ZERO, } from "../rational/rational-types.js";
|
|
26
|
+
import { registerConverter } from "./_factory.js";
|
|
27
|
+
import { _registerBigIntFractionCtor, Integer } from "./integer-num.js";
|
|
28
|
+
/**
|
|
29
|
+
* A rational number expressed as the exact fraction `p / q` with `p, q ∈ ℤ`, `q
|
|
30
|
+
*
|
|
31
|
+
* > 0`.
|
|
32
|
+
*
|
|
33
|
+
* The contract shell over {@link Rational}. Every operation delegates to the
|
|
34
|
+
* free functions in `rational.ts`; no arithmetic happens in this class. What it
|
|
35
|
+
* adds is the tower's uniform interface, the declared
|
|
36
|
+
* {@link AlgebraicStructure}, the evidence records and the promotion tag — none
|
|
37
|
+
* of which a bare pair of `bigint`s can carry.
|
|
38
|
+
*
|
|
39
|
+
* The `bigint` pair is also the storage, so arithmetic allocates no `Integer`.
|
|
40
|
+
* {@link numerator} and {@link denominator} wrap on access, which is rare and
|
|
41
|
+
* explicit.
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* const a = Fraction.from(1n, 3n);
|
|
45
|
+
* const b = Fraction.from(1n, 6n);
|
|
46
|
+
* a.add(b).reduce().format(); // "1/2"
|
|
47
|
+
* Fraction.from(4n, 9n).sqrt().format(); // "2/3"
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export class Fraction extends OrderedBase {
|
|
51
|
+
#value;
|
|
52
|
+
constructor(value) {
|
|
53
|
+
super();
|
|
54
|
+
this.#value = value;
|
|
55
|
+
}
|
|
56
|
+
// Static constants
|
|
57
|
+
/** The fraction `0/1`. */
|
|
58
|
+
static ZERO = new Fraction(RATIONAL_ZERO);
|
|
59
|
+
/** The fraction `1/1`. */
|
|
60
|
+
static ONE = new Fraction(RATIONAL_ONE);
|
|
61
|
+
/** The fraction `−1/1`. */
|
|
62
|
+
static NEG_ONE = new Fraction(rationalNeg(RATIONAL_ONE));
|
|
63
|
+
/** Unique type tag used by the factory and promotion tables. */
|
|
64
|
+
static TAG = Symbol("Fraction");
|
|
65
|
+
/** ℚ is an ordered field — exactly, since every operation is closed. */
|
|
66
|
+
static STRUCTURE = ORDERED_FIELD;
|
|
67
|
+
/**
|
|
68
|
+
* Evidence that `Fraction` forms an ordered field, for generic algorithms
|
|
69
|
+
* that take their structure as an argument rather than requiring it of the
|
|
70
|
+
* type. Verified against `checkOrderedFieldLaws`.
|
|
71
|
+
*/
|
|
72
|
+
static orderedField = {
|
|
73
|
+
zero: Fraction.ZERO,
|
|
74
|
+
one: Fraction.ONE,
|
|
75
|
+
add: (a, b) => a.add(b),
|
|
76
|
+
neg: (a) => a.neg(),
|
|
77
|
+
sub: (a, b) => a.sub(b),
|
|
78
|
+
mul: (a, b) => a.mul(b),
|
|
79
|
+
eq: (a, b) => a.cmp(b) === 0,
|
|
80
|
+
inv: (a) => a.inv(),
|
|
81
|
+
div: (a, b) => a.div(b),
|
|
82
|
+
cmp: (a, b) => a.cmp(b),
|
|
83
|
+
abs: (a) => a.abs(),
|
|
84
|
+
sign: (a) => a.sign(),
|
|
85
|
+
};
|
|
86
|
+
/** Field evidence, an alias of {@link orderedField} without the order. */
|
|
87
|
+
static field = Fraction.orderedField;
|
|
88
|
+
// Static factories
|
|
89
|
+
/**
|
|
90
|
+
* Creates a `Fraction` from a numerator and denominator, accepting `Integer`,
|
|
91
|
+
* `bigint` or an integral `number` for each.
|
|
92
|
+
*
|
|
93
|
+
* @throws {RangeError} When the denominator is zero.
|
|
94
|
+
*/
|
|
95
|
+
static from(numerator, denominator = 1n) {
|
|
96
|
+
return new Fraction(rationalNormalize(_toBigInt(numerator), _toBigInt(denominator)));
|
|
97
|
+
}
|
|
98
|
+
/** Wraps an already-normalised {@link Rational}. */
|
|
99
|
+
static fromRational(value) {
|
|
100
|
+
return new Fraction(value);
|
|
101
|
+
}
|
|
102
|
+
/** The underlying pair, for callers working at the arithmetic layer. */
|
|
103
|
+
toRational() {
|
|
104
|
+
return this.#value;
|
|
105
|
+
}
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// IFraction<Integer>
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
/** The numerator (may be negative). */
|
|
110
|
+
get numerator() {
|
|
111
|
+
return Integer.from(this.#value.numerator);
|
|
112
|
+
}
|
|
113
|
+
/** The denominator — always strictly positive. */
|
|
114
|
+
get denominator() {
|
|
115
|
+
return Integer.from(this.#value.denominator);
|
|
116
|
+
}
|
|
117
|
+
/** `true` when the fraction is known to be in lowest terms. */
|
|
118
|
+
get isReduced() {
|
|
119
|
+
return this.#value.reduced;
|
|
120
|
+
}
|
|
121
|
+
/** An equivalent fraction in lowest terms. */
|
|
122
|
+
reduce() {
|
|
123
|
+
const reduced = rationalReduce(this.#value);
|
|
124
|
+
return reduced === this.#value ? this : new Fraction(reduced);
|
|
125
|
+
}
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// INum
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
/** `p/q`, or just `p` when the denominator is one — exact in any radix. */
|
|
130
|
+
toString(radix) {
|
|
131
|
+
return rationalToString(this.#value, radix);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The decimal value, localized. `Intl` has no ratio notation, so this is the
|
|
135
|
+
* decimal expansion rather than {@link toString}'s `p/q` — rounded to whatever
|
|
136
|
+
* `options` asks for, which for a non-terminating fraction is the only thing
|
|
137
|
+
* it could be.
|
|
138
|
+
*/
|
|
139
|
+
format(locales, options) {
|
|
140
|
+
return rationalFormat(this.#value, locales, options);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Fixed-point notation with `fractionDigits` places. A repeating expansion is
|
|
144
|
+
* rounded there, since it has nowhere else to stop.
|
|
145
|
+
*/
|
|
146
|
+
toFixed(fractionDigits = 0) {
|
|
147
|
+
return decimalToFixed(this.#toDecimal(fractionDigits), fractionDigits);
|
|
148
|
+
}
|
|
149
|
+
/** Exponential notation, with as many places as asked for. */
|
|
150
|
+
toExponential(fractionDigits) {
|
|
151
|
+
return decimalToExponential(this.#toDecimal((fractionDigits ?? 0) + this.integralPrecision), fractionDigits);
|
|
152
|
+
}
|
|
153
|
+
/** `precision` significant digits, in whichever notation reads better. */
|
|
154
|
+
toPrecision(precision) {
|
|
155
|
+
return decimalToPrecision(this.#toDecimal(precision), precision);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The expansion to `places` places plus two guard digits, whose sticky last
|
|
159
|
+
* digit lets the caller round once more without the two roundings
|
|
160
|
+
* disagreeing.
|
|
161
|
+
*/
|
|
162
|
+
#toDecimal(places) {
|
|
163
|
+
return decimalFromString(rationalToDecimalString(this.#value, Math.max(places, 0) + 2));
|
|
164
|
+
}
|
|
165
|
+
/** The nearest binary64 approximation. */
|
|
166
|
+
valueOf() {
|
|
167
|
+
return rationalToNumber(this.#value);
|
|
168
|
+
}
|
|
169
|
+
[Symbol.toPrimitive](hint) {
|
|
170
|
+
return hint === "string" ? this.toString() : this.valueOf();
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Significant digits of the decimal expansion, or `Infinity` when it does not
|
|
174
|
+
* terminate.
|
|
175
|
+
*/
|
|
176
|
+
get decimalPrecision() {
|
|
177
|
+
return rationalDecimalPrecision(this.#value);
|
|
178
|
+
}
|
|
179
|
+
/** Decimal digits in the integer part of `|this|`. */
|
|
180
|
+
get integralPrecision() {
|
|
181
|
+
const { integral } = rationalIntegralFractional(rationalAbs(this.#value));
|
|
182
|
+
return integral.toString().length;
|
|
183
|
+
}
|
|
184
|
+
/** Decimal places in the exact expansion, or `Infinity` when it repeats. */
|
|
185
|
+
get fractionalPrecision() {
|
|
186
|
+
return rationalFractionalPrecision(this.#value);
|
|
187
|
+
}
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Ring and field operations
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
/** `(a/b) × (c/d)`. */
|
|
192
|
+
mul(other) {
|
|
193
|
+
return new Fraction(rationalMul(this.#value, other.#value));
|
|
194
|
+
}
|
|
195
|
+
/** The multiplicative identity `1/1`. */
|
|
196
|
+
identity() {
|
|
197
|
+
return Fraction.ONE;
|
|
198
|
+
}
|
|
199
|
+
/** `(a/b) + (c/d)`. */
|
|
200
|
+
add(other) {
|
|
201
|
+
return new Fraction(rationalAdd(this.#value, other.#value));
|
|
202
|
+
}
|
|
203
|
+
/** The additive identity `0/1`. */
|
|
204
|
+
zero() {
|
|
205
|
+
return Fraction.ZERO;
|
|
206
|
+
}
|
|
207
|
+
/** `−(a/b)`. */
|
|
208
|
+
neg() {
|
|
209
|
+
return new Fraction(rationalNeg(this.#value));
|
|
210
|
+
}
|
|
211
|
+
/** `(a/b) − (c/d)`. */
|
|
212
|
+
sub(other) {
|
|
213
|
+
return new Fraction(rationalSub(this.#value, other.#value));
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The reciprocal `b/a`.
|
|
217
|
+
*
|
|
218
|
+
* @throws {RangeError} When called on zero.
|
|
219
|
+
*/
|
|
220
|
+
inv() {
|
|
221
|
+
return new Fraction(rationalInv(this.#value));
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* `(a/b) ÷ (c/d)`.
|
|
225
|
+
*
|
|
226
|
+
* @throws {RangeError} When `other` is zero.
|
|
227
|
+
*/
|
|
228
|
+
div(other) {
|
|
229
|
+
return new Fraction(rationalDiv(this.#value, other.#value));
|
|
230
|
+
}
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
// Order
|
|
233
|
+
// ---------------------------------------------------------------------------
|
|
234
|
+
/** Three-way comparison. */
|
|
235
|
+
cmp(other) {
|
|
236
|
+
return rationalCompare(this.#value, other.#value);
|
|
237
|
+
}
|
|
238
|
+
// ---------------------------------------------------------------------------
|
|
239
|
+
// Real operations
|
|
240
|
+
// ---------------------------------------------------------------------------
|
|
241
|
+
/** `|a/b|`. */
|
|
242
|
+
abs() {
|
|
243
|
+
const value = rationalAbs(this.#value);
|
|
244
|
+
return value === this.#value ? this : new Fraction(value);
|
|
245
|
+
}
|
|
246
|
+
/** `-1` for negative, `0` for zero, `1` for positive. */
|
|
247
|
+
sign() {
|
|
248
|
+
return rationalSign(this.#value);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The exact square root, when numerator and denominator are both perfect
|
|
252
|
+
* squares.
|
|
253
|
+
*
|
|
254
|
+
* @throws {RangeError} When this fraction is negative, or the root is
|
|
255
|
+
* irrational.
|
|
256
|
+
*/
|
|
257
|
+
sqrt() {
|
|
258
|
+
const root = rationalSqrtExact(this.#value);
|
|
259
|
+
if (root === null) {
|
|
260
|
+
throw new RangeError("Square root of this Fraction is irrational — use Decimal for an approximation");
|
|
261
|
+
}
|
|
262
|
+
return new Fraction(root);
|
|
263
|
+
}
|
|
264
|
+
// ---------------------------------------------------------------------------
|
|
265
|
+
// Exact rational form
|
|
266
|
+
// ---------------------------------------------------------------------------
|
|
267
|
+
/** Returns this fraction — it is already in ℚ exact form. */
|
|
268
|
+
toFraction() {
|
|
269
|
+
return this;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function _toBigInt(value) {
|
|
273
|
+
if (typeof value === "bigint") {
|
|
274
|
+
return value;
|
|
275
|
+
}
|
|
276
|
+
if (typeof value === "number") {
|
|
277
|
+
return BigInt(value);
|
|
278
|
+
}
|
|
279
|
+
return value.toBigInt();
|
|
280
|
+
}
|
|
281
|
+
// Integer.inv() produces a Fraction, so the constructor is handed over once
|
|
282
|
+
// this class body has been evaluated.
|
|
283
|
+
_registerBigIntFractionCtor((n, d) => Fraction.from(n, d));
|
|
284
|
+
registerConverter(Fraction.TAG, (value) => {
|
|
285
|
+
if (value instanceof Fraction) {
|
|
286
|
+
return value;
|
|
287
|
+
}
|
|
288
|
+
if (value instanceof Integer) {
|
|
289
|
+
return Fraction.from(value);
|
|
290
|
+
}
|
|
291
|
+
if (typeof value === "bigint") {
|
|
292
|
+
return Fraction.from(value);
|
|
293
|
+
}
|
|
294
|
+
if (typeof value === "number" && Number.isInteger(value)) {
|
|
295
|
+
return Fraction.from(value);
|
|
296
|
+
}
|
|
297
|
+
return null;
|
|
298
|
+
});
|
|
299
|
+
//# sourceMappingURL=fraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fraction.js","sourceRoot":"","sources":["../../src/num/fraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,WAAW,GAKX,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AA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C,KAAK,EAAE,EAAE;IACzC,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,KAAK,YAAY,OAAO,EAAE,CAAC;QAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1D,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bitwise operations available on types whose elements have a two's-complement
|
|
3
|
+
* or unsigned binary representation.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The carrier set.
|
|
6
|
+
*/
|
|
7
|
+
export interface IBitwise<T extends IBitwise<T>> {
|
|
8
|
+
bitwiseAnd(other: T): T;
|
|
9
|
+
bitwiseOr(other: T): T;
|
|
10
|
+
bitwiseXor(other: T): T;
|
|
11
|
+
bitwiseNot(): T;
|
|
12
|
+
/** Logical/arithmetic left shift by `count` bit positions. */
|
|
13
|
+
shiftLeft(count: number): T;
|
|
14
|
+
/** Arithmetic right shift, preserving the sign for signed types. */
|
|
15
|
+
shiftRight(count: number): T;
|
|
16
|
+
/** Logical right shift, filling with zero bits on the left. */
|
|
17
|
+
unsignedShiftRight(count: number): T;
|
|
18
|
+
/** Number of bits required to represent the magnitude, excluding the sign. */
|
|
19
|
+
bitLength(): number;
|
|
20
|
+
/** Count of set bits in the magnitude. */
|
|
21
|
+
popCount(): number;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ibitwise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ibitwise.d.ts","sourceRoot":"","sources":["../../src/num/ibitwise.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC;IAC9C,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACxB,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACvB,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACxB,UAAU,IAAI,CAAC,CAAC;IAEhB,8DAA8D;IAC9D,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC;IAE5B,oEAAoE;IACpE,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC;IAE7B,+DAA+D;IAC/D,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC;IAErC,8EAA8E;IAC9E,SAAS,IAAI,MAAM,CAAC;IAEpB,0CAA0C;IAC1C,QAAQ,IAAI,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ibitwise.js","sourceRoot":"","sources":["../../src/num/ibitwise.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import type { AlgebraicStructure, EuclideanDomain, QuotientRemainder, Ring, Sign } from "@ac-kit/math-algebra";
|
|
2
|
+
import { OrderedBase } from "@ac-kit/math-algebra";
|
|
3
|
+
import type { IntegralFractional } from "../integral-fractional.js";
|
|
4
|
+
import type { OverflowMode } from "../overflow-mode.js";
|
|
5
|
+
import type { ArbitraryPrecisionInfo, IArbitraryPrecision, IDecimalEncoded } from "../precision-kind.js";
|
|
6
|
+
import type { Fraction } from "./fraction.js";
|
|
7
|
+
import { IBitwise } from "./ibitwise.js";
|
|
8
|
+
import { INum } from "./inum.js";
|
|
9
|
+
type FractionCtor = (n: Integer, d: Integer) => Fraction;
|
|
10
|
+
/**
|
|
11
|
+
* Registers the `Fraction` constructor for use by `Integer.inv()`, `.div()`,
|
|
12
|
+
* and `.toFraction()`. Called once by the `fraction.ts` module.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function _registerBigIntFractionCtor(ctor: FractionCtor): void;
|
|
17
|
+
/**
|
|
18
|
+
* An arbitrary-precision integer, wrapping the native `bigint` primitive.
|
|
19
|
+
*
|
|
20
|
+
* Full integer arithmetic, Euclidean division, bitwise operations, GCD/LCM and
|
|
21
|
+
* primality testing. Its algebraic structure is stated as evidence:
|
|
22
|
+
* {@link Integer.ring} and {@link Integer.euclideanDomain}.
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* const a = Integer.from(12n);
|
|
26
|
+
* const b = Integer.from(8n);
|
|
27
|
+
* a.add(b).format(); // "20"
|
|
28
|
+
* a.gcd(b).format(); // "4"
|
|
29
|
+
* a.inv().format(); // "1/12" (returns a Fraction)
|
|
30
|
+
* Integer.from(7n).isPrime(); // true
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class Integer extends OrderedBase<Integer> implements INum, IArbitraryPrecision, IDecimalEncoded, IBitwise<Integer> {
|
|
34
|
+
#private;
|
|
35
|
+
readonly precisionKind: "arbitrary";
|
|
36
|
+
readonly radix: 10;
|
|
37
|
+
private constructor();
|
|
38
|
+
/** Additive identity `0`. */
|
|
39
|
+
static readonly ZERO: Integer;
|
|
40
|
+
/** Multiplicative identity `1`. */
|
|
41
|
+
static readonly ONE: Integer;
|
|
42
|
+
/** The integer `2`. */
|
|
43
|
+
static readonly TWO: Integer;
|
|
44
|
+
/** The integer `10`. */
|
|
45
|
+
static readonly TEN: Integer;
|
|
46
|
+
/** Unique type tag used by {@link NumFactory} and {@link NumPromote}. */
|
|
47
|
+
static readonly TAG: unique symbol;
|
|
48
|
+
/** ℤ is an integral domain, not a field — only ±1 are invertible. */
|
|
49
|
+
static readonly STRUCTURE: AlgebraicStructure;
|
|
50
|
+
/**
|
|
51
|
+
* Format descriptor for arbitrary-precision decimal integers. Radix 10;
|
|
52
|
+
* exponent range is `[0, +∞)` (integers have no fractional part).
|
|
53
|
+
*/
|
|
54
|
+
static readonly FORMAT_INFO: ArbitraryPrecisionInfo;
|
|
55
|
+
/**
|
|
56
|
+
* Evidence that `Integer` forms a [Euclidean
|
|
57
|
+
* domain](https://en.wikipedia.org/wiki/Euclidean_domain).
|
|
58
|
+
*
|
|
59
|
+
* Pass to generic algorithms such as `gcd()` or `lcm()` that accept any
|
|
60
|
+
* Euclidean domain. Because every Euclidean domain is also a ring, this
|
|
61
|
+
* object also satisfies `Ring<Integer>` — see {@link ring}.
|
|
62
|
+
*/
|
|
63
|
+
static readonly euclideanDomain: EuclideanDomain<Integer>;
|
|
64
|
+
/**
|
|
65
|
+
* Evidence that `Integer` forms a
|
|
66
|
+
* [ring](https://en.wikipedia.org/wiki/Ring_(mathematics)).
|
|
67
|
+
*
|
|
68
|
+
* Identical to {@link euclideanDomain} — `Integer` satisfies all ring laws.
|
|
69
|
+
* Provided as a convenience alias when only ring operations are needed by the
|
|
70
|
+
* receiving algorithm.
|
|
71
|
+
*/
|
|
72
|
+
static readonly ring: Ring<Integer>;
|
|
73
|
+
/** Creates a `Integer` from a `bigint`, `number`, or decimal string. */
|
|
74
|
+
static from(value: bigint | number | string): Integer;
|
|
75
|
+
/**
|
|
76
|
+
* Parses a string in any radix from 2 to 36.
|
|
77
|
+
*
|
|
78
|
+
* @throws {SyntaxError} When the string is not a valid integer in the given
|
|
79
|
+
* radix.
|
|
80
|
+
*/
|
|
81
|
+
static parse(s: string, radix?: number): Integer;
|
|
82
|
+
/** Returns the underlying `bigint` value. */
|
|
83
|
+
toBigInt(): bigint;
|
|
84
|
+
/** The exact numeral, in `radix` when given — every base from 2 to 36. */
|
|
85
|
+
toString(radix?: number): string;
|
|
86
|
+
format(locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string;
|
|
87
|
+
/** Fixed-point notation with `fractionDigits` places, all of them zeros. */
|
|
88
|
+
toFixed(fractionDigits?: number): string;
|
|
89
|
+
/** Exponential notation, with as many places as asked for. */
|
|
90
|
+
toExponential(fractionDigits?: number): string;
|
|
91
|
+
/** `precision` significant digits, in whichever notation reads better. */
|
|
92
|
+
toPrecision(precision: number): string;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the nearest IEEE 754 double-precision approximation. Lossy for
|
|
95
|
+
* large values.
|
|
96
|
+
*/
|
|
97
|
+
valueOf(): number;
|
|
98
|
+
/**
|
|
99
|
+
* Coerces to a JS primitive. Returns `bigint` for numeric hints, string for
|
|
100
|
+
* string hint.
|
|
101
|
+
*/
|
|
102
|
+
[Symbol.toPrimitive](hint: "number" | "string" | "default"): number | string | bigint;
|
|
103
|
+
/** Number of significant decimal digits in `|this|`. Minimum `1` (for zero). */
|
|
104
|
+
get decimalPrecision(): number;
|
|
105
|
+
/**
|
|
106
|
+
* Number of decimal digits in the integer part of `|this|`. Equal to
|
|
107
|
+
* `decimalPrecision` for all integers (no fractional part).
|
|
108
|
+
*/
|
|
109
|
+
get integralPrecision(): number;
|
|
110
|
+
/** Integers have no fractional digits — always `0`. */
|
|
111
|
+
get fractionalPrecision(): number;
|
|
112
|
+
/**
|
|
113
|
+
* Returns `this × other`.
|
|
114
|
+
*
|
|
115
|
+
* `mode` is accepted for interface compatibility with fixed-width integer
|
|
116
|
+
* types but is ignored — `Integer` is arbitrary-precision and never
|
|
117
|
+
* overflows.
|
|
118
|
+
*/
|
|
119
|
+
mul(other: Integer, _mode?: OverflowMode): Integer;
|
|
120
|
+
/** Returns the multiplicative identity `1`. */
|
|
121
|
+
one(): Integer;
|
|
122
|
+
/**
|
|
123
|
+
* Returns `this + other`.
|
|
124
|
+
*
|
|
125
|
+
* `mode` is accepted for interface compatibility with fixed-width integer
|
|
126
|
+
* types but is ignored — `Integer` is arbitrary-precision and never
|
|
127
|
+
* overflows.
|
|
128
|
+
*/
|
|
129
|
+
add(other: Integer, _mode?: OverflowMode): Integer;
|
|
130
|
+
/** Returns the additive identity `0`. */
|
|
131
|
+
zero(): Integer;
|
|
132
|
+
/**
|
|
133
|
+
* Returns `−this`.
|
|
134
|
+
*
|
|
135
|
+
* `mode` is accepted for interface compatibility with fixed-width integer
|
|
136
|
+
* types but is ignored — `Integer` is arbitrary-precision and never
|
|
137
|
+
* overflows.
|
|
138
|
+
*/
|
|
139
|
+
neg(_mode?: OverflowMode): Integer;
|
|
140
|
+
/**
|
|
141
|
+
* Returns `this − other`.
|
|
142
|
+
*
|
|
143
|
+
* `mode` is accepted for interface compatibility with fixed-width integer
|
|
144
|
+
* types but is ignored.
|
|
145
|
+
*/
|
|
146
|
+
sub(other: Integer, _mode?: OverflowMode): Integer;
|
|
147
|
+
/**
|
|
148
|
+
* Three-way comparison.
|
|
149
|
+
*
|
|
150
|
+
* @returns `-1` if `this < other`, `0` if equal, `+1` if `this > other`.
|
|
151
|
+
*/
|
|
152
|
+
cmp(other: Integer): Sign;
|
|
153
|
+
/**
|
|
154
|
+
* Floored integer quotient `⌊this / other⌋`. For positive arguments this
|
|
155
|
+
* equals truncated division. For negative arguments, floors toward −∞ so that
|
|
156
|
+
* `mod` is always non-negative.
|
|
157
|
+
*
|
|
158
|
+
* @throws {RangeError} When `other` is zero.
|
|
159
|
+
*/
|
|
160
|
+
intdiv(other: Integer): Integer;
|
|
161
|
+
/**
|
|
162
|
+
* Non-negative Euclidean remainder: `this − other × intdiv(this, other)`.
|
|
163
|
+
* Satisfies `0 ≤ mod(a, b) < |b|` for all `a` and nonzero `b`.
|
|
164
|
+
*
|
|
165
|
+
* @throws {RangeError} When `other` is zero.
|
|
166
|
+
*/
|
|
167
|
+
mod(other: Integer): Integer;
|
|
168
|
+
/** Returns `this & other` (bitwise AND). */
|
|
169
|
+
bitwiseAnd(other: Integer): Integer;
|
|
170
|
+
/** Returns `this | other` (bitwise OR). */
|
|
171
|
+
bitwiseOr(other: Integer): Integer;
|
|
172
|
+
/** Returns `this ^ other` (bitwise XOR). */
|
|
173
|
+
bitwiseXor(other: Integer): Integer;
|
|
174
|
+
/** Returns `~this` (bitwise NOT). In two's complement: `~n = −n − 1`. */
|
|
175
|
+
bitwiseNot(): Integer;
|
|
176
|
+
/** Returns `this << n`. Equivalent to multiplying by `2ⁿ`. */
|
|
177
|
+
shiftLeft(n: number): Integer;
|
|
178
|
+
/** Returns `this >> n` (arithmetic right shift — sign bit preserved). */
|
|
179
|
+
shiftRight(n: number): Integer;
|
|
180
|
+
/**
|
|
181
|
+
* Logical (unsigned) right shift `this >>> n`, treating the value as a 64-bit
|
|
182
|
+
* unsigned integer. Fills with zero bits on the left.
|
|
183
|
+
*/
|
|
184
|
+
unsignedShiftRight(n: number): Integer;
|
|
185
|
+
bitLength(): number;
|
|
186
|
+
popCount(): number;
|
|
187
|
+
/**
|
|
188
|
+
* Absolute value `|this|`.
|
|
189
|
+
*
|
|
190
|
+
* Reference: https://en.wikipedia.org/wiki/Absolute_value
|
|
191
|
+
*/
|
|
192
|
+
abs(): Integer;
|
|
193
|
+
/**
|
|
194
|
+
* Sign of this integer.
|
|
195
|
+
*
|
|
196
|
+
* @returns `-1`, `0`, or `+1`. Reference:
|
|
197
|
+
* https://en.wikipedia.org/wiki/Sign_(mathematics)
|
|
198
|
+
*/
|
|
199
|
+
sign(): Sign;
|
|
200
|
+
/**
|
|
201
|
+
* Integer floor square root `⌊√this⌋`.
|
|
202
|
+
*
|
|
203
|
+
* @throws {RangeError} When `this < 0` (square root of a negative integer is
|
|
204
|
+
* not a real number — use a complex type instead). Reference:
|
|
205
|
+
* https://en.wikipedia.org/wiki/Integer_square_root
|
|
206
|
+
*/
|
|
207
|
+
sqrt(): Integer;
|
|
208
|
+
/**
|
|
209
|
+
* Returns `1 / this` as an exact {@link Fraction} in ℚ.
|
|
210
|
+
*
|
|
211
|
+
* @throws {RangeError} When called on zero.
|
|
212
|
+
*/
|
|
213
|
+
inv(): Fraction;
|
|
214
|
+
/**
|
|
215
|
+
* Returns `this / other` as an exact {@link Fraction} in ℚ. For the truncating
|
|
216
|
+
* integer quotient, use {@link intdiv}.
|
|
217
|
+
*
|
|
218
|
+
* @throws {RangeError} When `other` is zero.
|
|
219
|
+
*/
|
|
220
|
+
div(other: Integer): Fraction;
|
|
221
|
+
/** Returns this integer as the fraction `this / 1`. */
|
|
222
|
+
toFraction(): Fraction;
|
|
223
|
+
/**
|
|
224
|
+
* Returns `gcd(this, other)` — the largest integer that divides both. Always
|
|
225
|
+
* non-negative. `gcd(0, 0) = 0`.
|
|
226
|
+
*/
|
|
227
|
+
gcd(other: Integer): Integer;
|
|
228
|
+
/**
|
|
229
|
+
* Returns `lcm(this, other)` — the smallest positive integer divisible by
|
|
230
|
+
* both. Returns `0` when either operand is zero.
|
|
231
|
+
*/
|
|
232
|
+
lcm(other: Integer): Integer;
|
|
233
|
+
/**
|
|
234
|
+
* Returns `true` if this integer is a prime number (positive, greater than 1,
|
|
235
|
+
* divisible only by 1 and itself). Uses a deterministic Miller–Rabin test.
|
|
236
|
+
*/
|
|
237
|
+
isPrime(): boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Returns the decimal digit at the given `position`. Position `0` is the ones
|
|
240
|
+
* digit, `1` is tens, `2` is hundreds, etc. Negative positions (fractional
|
|
241
|
+
* digits) always return `0` for integers.
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```ts
|
|
245
|
+
* Integer.from(1234n).digitAt(0); // → 4
|
|
246
|
+
* Integer.from(1234n).digitAt(3); // → 1
|
|
247
|
+
* Integer.from(1234n).digitAt(4); // → 0
|
|
248
|
+
* Integer.from(1234n).digitAt(-1); // → 0
|
|
249
|
+
* ```;
|
|
250
|
+
*/
|
|
251
|
+
digitAt(position: number): number;
|
|
252
|
+
/**
|
|
253
|
+
* Returns the floored quotient and non-negative remainder of `this ÷ other`
|
|
254
|
+
* as a {@link QuotientRemainder} pair.
|
|
255
|
+
*
|
|
256
|
+
* Invariant: `other × q + r = this` and `0 ≤ r < |other|`.
|
|
257
|
+
*
|
|
258
|
+
* @throws {RangeError} When `other` is zero.
|
|
259
|
+
*/
|
|
260
|
+
divmod(other: Integer): QuotientRemainder<Integer, Integer>;
|
|
261
|
+
/**
|
|
262
|
+
* Returns this integer as an {@link IntegralFractional}. The fractional part
|
|
263
|
+
* `f` is always `0n` because integers have no fraction.
|
|
264
|
+
*/
|
|
265
|
+
toIntegralFractional(): IntegralFractional;
|
|
266
|
+
}
|
|
267
|
+
export {};
|
|
268
|
+
//# sourceMappingURL=integer-num.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integer-num.d.ts","sourceRoot":"","sources":["../../src/num/integer-num.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,IAAI,EACJ,IAAI,EACJ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAmB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAgBpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACX,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAMjC,KAAK,YAAY,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,KAAK,QAAQ,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAEpE;AAMD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa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