@nberlette/math 0.7.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 +20 -0
- package/README.md +889 -0
- package/cjs/abs.d.ts +14 -0
- package/cjs/abs.d.ts.map +1 -0
- package/cjs/abs.js +22 -0
- package/cjs/abs.js.map +1 -0
- package/cjs/acos.d.ts +17 -0
- package/cjs/acos.d.ts.map +1 -0
- package/cjs/acos.js +27 -0
- package/cjs/acos.js.map +1 -0
- package/cjs/acosh.d.ts +11 -0
- package/cjs/acosh.d.ts.map +1 -0
- package/cjs/acosh.js +35 -0
- package/cjs/acosh.js.map +1 -0
- package/cjs/asin.d.ts +11 -0
- package/cjs/asin.d.ts.map +1 -0
- package/cjs/asin.js +28 -0
- package/cjs/asin.js.map +1 -0
- package/cjs/asinh.d.ts +9 -0
- package/cjs/asinh.d.ts.map +1 -0
- package/cjs/asinh.js +26 -0
- package/cjs/asinh.js.map +1 -0
- package/cjs/atan.d.ts +11 -0
- package/cjs/atan.d.ts.map +1 -0
- package/cjs/atan.js +65 -0
- package/cjs/atan.js.map +1 -0
- package/cjs/atan2.d.ts +12 -0
- package/cjs/atan2.d.ts.map +1 -0
- package/cjs/atan2.js +70 -0
- package/cjs/atan2.js.map +1 -0
- package/cjs/atanh.d.ts +11 -0
- package/cjs/atanh.d.ts.map +1 -0
- package/cjs/atanh.js +32 -0
- package/cjs/atanh.js.map +1 -0
- package/cjs/cbrt.d.ts +9 -0
- package/cjs/cbrt.d.ts.map +1 -0
- package/cjs/cbrt.js +26 -0
- package/cjs/cbrt.js.map +1 -0
- package/cjs/ceil.d.ts +15 -0
- package/cjs/ceil.d.ts.map +1 -0
- package/cjs/ceil.js +34 -0
- package/cjs/ceil.js.map +1 -0
- package/cjs/clamp.d.ts +15 -0
- package/cjs/clamp.d.ts.map +1 -0
- package/cjs/clamp.js +32 -0
- package/cjs/clamp.js.map +1 -0
- package/cjs/clz32.d.ts +20 -0
- package/cjs/clz32.d.ts.map +1 -0
- package/cjs/clz32.js +48 -0
- package/cjs/clz32.js.map +1 -0
- package/cjs/constants/e.d.ts +17 -0
- package/cjs/constants/e.d.ts.map +1 -0
- package/cjs/constants/e.js +19 -0
- package/cjs/constants/e.js.map +1 -0
- package/cjs/constants/epsilon.d.ts +24 -0
- package/cjs/constants/epsilon.d.ts.map +1 -0
- package/cjs/constants/epsilon.js +26 -0
- package/cjs/constants/epsilon.js.map +1 -0
- package/cjs/constants/index.d.ts +23 -0
- package/cjs/constants/index.d.ts.map +1 -0
- package/cjs/constants/index.js +39 -0
- package/cjs/constants/index.js.map +1 -0
- package/cjs/constants/infinity.d.ts +3 -0
- package/cjs/constants/infinity.d.ts.map +1 -0
- package/cjs/constants/infinity.js +19 -0
- package/cjs/constants/infinity.js.map +1 -0
- package/cjs/constants/ln10.d.ts +10 -0
- package/cjs/constants/ln10.d.ts.map +1 -0
- package/cjs/constants/ln10.js +12 -0
- package/cjs/constants/ln10.js.map +1 -0
- package/cjs/constants/ln2.d.ts +10 -0
- package/cjs/constants/ln2.d.ts.map +1 -0
- package/cjs/constants/ln2.js +12 -0
- package/cjs/constants/ln2.js.map +1 -0
- package/cjs/constants/log10e.d.ts +10 -0
- package/cjs/constants/log10e.d.ts.map +1 -0
- package/cjs/constants/log10e.js +12 -0
- package/cjs/constants/log10e.js.map +1 -0
- package/cjs/constants/log2e.d.ts +10 -0
- package/cjs/constants/log2e.d.ts.map +1 -0
- package/cjs/constants/log2e.js +12 -0
- package/cjs/constants/log2e.js.map +1 -0
- package/cjs/constants/max_safe_integer.d.ts +11 -0
- package/cjs/constants/max_safe_integer.d.ts.map +1 -0
- package/cjs/constants/max_safe_integer.js +13 -0
- package/cjs/constants/max_safe_integer.js.map +1 -0
- package/cjs/constants/max_value.d.ts +10 -0
- package/cjs/constants/max_value.d.ts.map +1 -0
- package/cjs/constants/max_value.js +12 -0
- package/cjs/constants/max_value.js.map +1 -0
- package/cjs/constants/min_safe_integer.d.ts +12 -0
- package/cjs/constants/min_safe_integer.d.ts.map +1 -0
- package/cjs/constants/min_safe_integer.js +14 -0
- package/cjs/constants/min_safe_integer.js.map +1 -0
- package/cjs/constants/min_value.d.ts +10 -0
- package/cjs/constants/min_value.d.ts.map +1 -0
- package/cjs/constants/min_value.js +12 -0
- package/cjs/constants/min_value.js.map +1 -0
- package/cjs/constants/nan.d.ts +47 -0
- package/cjs/constants/nan.d.ts.map +1 -0
- package/cjs/constants/nan.js +30 -0
- package/cjs/constants/nan.js.map +1 -0
- package/cjs/constants/negative_infinity.d.ts +28 -0
- package/cjs/constants/negative_infinity.d.ts.map +1 -0
- package/cjs/constants/negative_infinity.js +15 -0
- package/cjs/constants/negative_infinity.js.map +1 -0
- package/cjs/constants/negative_zero.d.ts +31 -0
- package/cjs/constants/negative_zero.d.ts.map +1 -0
- package/cjs/constants/negative_zero.js +21 -0
- package/cjs/constants/negative_zero.js.map +1 -0
- package/cjs/constants/pi.d.ts +10 -0
- package/cjs/constants/pi.d.ts.map +1 -0
- package/cjs/constants/pi.js +12 -0
- package/cjs/constants/pi.js.map +1 -0
- package/cjs/constants/positive_infinity.d.ts +29 -0
- package/cjs/constants/positive_infinity.d.ts.map +1 -0
- package/cjs/constants/positive_infinity.js +16 -0
- package/cjs/constants/positive_infinity.js.map +1 -0
- package/cjs/constants/positive_zero.d.ts +38 -0
- package/cjs/constants/positive_zero.d.ts.map +1 -0
- package/cjs/constants/positive_zero.js +36 -0
- package/cjs/constants/positive_zero.js.map +1 -0
- package/cjs/constants/sqrt1_2.d.ts +9 -0
- package/cjs/constants/sqrt1_2.d.ts.map +1 -0
- package/cjs/constants/sqrt1_2.js +11 -0
- package/cjs/constants/sqrt1_2.js.map +1 -0
- package/cjs/constants/sqrt2.d.ts +9 -0
- package/cjs/constants/sqrt2.d.ts.map +1 -0
- package/cjs/constants/sqrt2.js +11 -0
- package/cjs/constants/sqrt2.js.map +1 -0
- package/cjs/cos.d.ts +10 -0
- package/cjs/cos.d.ts.map +1 -0
- package/cjs/cos.js +32 -0
- package/cjs/cos.js.map +1 -0
- package/cjs/cosh.d.ts +10 -0
- package/cjs/cosh.d.ts.map +1 -0
- package/cjs/cosh.js +21 -0
- package/cjs/cosh.js.map +1 -0
- package/cjs/exp.d.ts +20 -0
- package/cjs/exp.d.ts.map +1 -0
- package/cjs/exp.js +48 -0
- package/cjs/exp.js.map +1 -0
- package/cjs/expm1.d.ts +11 -0
- package/cjs/expm1.d.ts.map +1 -0
- package/cjs/expm1.js +38 -0
- package/cjs/expm1.js.map +1 -0
- package/cjs/f16round.d.ts +24 -0
- package/cjs/f16round.d.ts.map +1 -0
- package/cjs/f16round.js +42 -0
- package/cjs/f16round.js.map +1 -0
- package/cjs/float16/constants.d.ts +97 -0
- package/cjs/float16/constants.d.ts.map +1 -0
- package/cjs/float16/constants.js +99 -0
- package/cjs/float16/constants.js.map +1 -0
- package/cjs/float16/decode.d.ts +40 -0
- package/cjs/float16/decode.d.ts.map +1 -0
- package/cjs/float16/decode.js +67 -0
- package/cjs/float16/decode.js.map +1 -0
- package/cjs/float16/encode.d.ts +67 -0
- package/cjs/float16/encode.d.ts.map +1 -0
- package/cjs/float16/encode.js +77 -0
- package/cjs/float16/encode.js.map +1 -0
- package/cjs/float16/guards.d.ts +22 -0
- package/cjs/float16/guards.d.ts.map +1 -0
- package/cjs/float16/guards.js +15 -0
- package/cjs/float16/guards.js.map +1 -0
- package/cjs/float16/index.d.ts +11 -0
- package/cjs/float16/index.d.ts.map +1 -0
- package/cjs/float16/index.js +27 -0
- package/cjs/float16/index.js.map +1 -0
- package/cjs/float16/round.d.ts +25 -0
- package/cjs/float16/round.d.ts.map +1 -0
- package/cjs/float16/round.js +46 -0
- package/cjs/float16/round.js.map +1 -0
- package/cjs/float32/constants.d.ts +96 -0
- package/cjs/float32/constants.d.ts.map +1 -0
- package/cjs/float32/constants.js +98 -0
- package/cjs/float32/constants.js.map +1 -0
- package/cjs/float32/decode.d.ts +38 -0
- package/cjs/float32/decode.d.ts.map +1 -0
- package/cjs/float32/decode.js +70 -0
- package/cjs/float32/decode.js.map +1 -0
- package/cjs/float32/encode.d.ts +50 -0
- package/cjs/float32/encode.d.ts.map +1 -0
- package/cjs/float32/encode.js +77 -0
- package/cjs/float32/encode.js.map +1 -0
- package/cjs/float32/guards.d.ts +37 -0
- package/cjs/float32/guards.d.ts.map +1 -0
- package/cjs/float32/guards.js +20 -0
- package/cjs/float32/guards.js.map +1 -0
- package/cjs/float32/index.d.ts +11 -0
- package/cjs/float32/index.d.ts.map +1 -0
- package/cjs/float32/index.js +27 -0
- package/cjs/float32/index.js.map +1 -0
- package/cjs/float32/round.d.ts +23 -0
- package/cjs/float32/round.d.ts.map +1 -0
- package/cjs/float32/round.js +36 -0
- package/cjs/float32/round.js.map +1 -0
- package/cjs/floor.d.ts +10 -0
- package/cjs/floor.d.ts.map +1 -0
- package/cjs/floor.js +32 -0
- package/cjs/floor.js.map +1 -0
- package/cjs/fround.d.ts +23 -0
- package/cjs/fround.d.ts.map +1 -0
- package/cjs/fround.js +35 -0
- package/cjs/fround.js.map +1 -0
- package/cjs/guards/finite.d.ts +23 -0
- package/cjs/guards/finite.d.ts.map +1 -0
- package/cjs/guards/finite.js +21 -0
- package/cjs/guards/finite.js.map +1 -0
- package/cjs/guards/index.d.ts +50 -0
- package/cjs/guards/index.d.ts.map +1 -0
- package/cjs/guards/index.js +66 -0
- package/cjs/guards/index.js.map +1 -0
- package/cjs/guards/infinity.d.ts +3 -0
- package/cjs/guards/infinity.d.ts.map +1 -0
- package/cjs/guards/infinity.js +19 -0
- package/cjs/guards/infinity.js.map +1 -0
- package/cjs/guards/integer.d.ts +47 -0
- package/cjs/guards/integer.d.ts.map +1 -0
- package/cjs/guards/integer.js +23 -0
- package/cjs/guards/integer.js.map +1 -0
- package/cjs/guards/nan.d.ts +61 -0
- package/cjs/guards/nan.d.ts.map +1 -0
- package/cjs/guards/nan.js +68 -0
- package/cjs/guards/nan.js.map +1 -0
- package/cjs/guards/negative_infinity.d.ts +19 -0
- package/cjs/guards/negative_infinity.d.ts.map +1 -0
- package/cjs/guards/negative_infinity.js +25 -0
- package/cjs/guards/negative_infinity.js.map +1 -0
- package/cjs/guards/negative_zero.d.ts +12 -0
- package/cjs/guards/negative_zero.d.ts.map +1 -0
- package/cjs/guards/negative_zero.js +24 -0
- package/cjs/guards/negative_zero.js.map +1 -0
- package/cjs/guards/positive_infinity.d.ts +19 -0
- package/cjs/guards/positive_infinity.d.ts.map +1 -0
- package/cjs/guards/positive_infinity.js +25 -0
- package/cjs/guards/positive_infinity.js.map +1 -0
- package/cjs/guards/positive_zero.d.ts +17 -0
- package/cjs/guards/positive_zero.d.ts.map +1 -0
- package/cjs/guards/positive_zero.js +36 -0
- package/cjs/guards/positive_zero.js.map +1 -0
- package/cjs/guards/safe_integer.d.ts +33 -0
- package/cjs/guards/safe_integer.d.ts.map +1 -0
- package/cjs/guards/safe_integer.js +27 -0
- package/cjs/guards/safe_integer.js.map +1 -0
- package/cjs/hypot.d.ts +18 -0
- package/cjs/hypot.d.ts.map +1 -0
- package/cjs/hypot.js +63 -0
- package/cjs/hypot.js.map +1 -0
- package/cjs/ieee754.d.ts +16 -0
- package/cjs/ieee754.d.ts.map +1 -0
- package/cjs/ieee754.js +32 -0
- package/cjs/ieee754.js.map +1 -0
- package/cjs/imul.d.ts +17 -0
- package/cjs/imul.d.ts.map +1 -0
- package/cjs/imul.js +24 -0
- package/cjs/imul.js.map +1 -0
- package/cjs/index.d.ts +84 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js +113 -0
- package/cjs/index.js.map +1 -0
- package/cjs/internal/ieee754.d.ts +174 -0
- package/cjs/internal/ieee754.d.ts.map +1 -0
- package/cjs/internal/ieee754.js +200 -0
- package/cjs/internal/ieee754.js.map +1 -0
- package/cjs/internal/primordials.d.ts +30 -0
- package/cjs/internal/primordials.d.ts.map +1 -0
- package/cjs/internal/primordials.js +30 -0
- package/cjs/internal/primordials.js.map +1 -0
- package/cjs/log.d.ts +9 -0
- package/cjs/log.d.ts.map +1 -0
- package/cjs/log.js +46 -0
- package/cjs/log.js.map +1 -0
- package/cjs/log10.d.ts +9 -0
- package/cjs/log10.d.ts.map +1 -0
- package/cjs/log10.js +21 -0
- package/cjs/log10.js.map +1 -0
- package/cjs/log1p.d.ts +10 -0
- package/cjs/log1p.d.ts.map +1 -0
- package/cjs/log1p.js +32 -0
- package/cjs/log1p.js.map +1 -0
- package/cjs/log2.d.ts +12 -0
- package/cjs/log2.d.ts.map +1 -0
- package/cjs/log2.js +24 -0
- package/cjs/log2.js.map +1 -0
- package/cjs/max.d.ts +22 -0
- package/cjs/max.d.ts.map +1 -0
- package/cjs/max.js +51 -0
- package/cjs/max.js.map +1 -0
- package/cjs/min.d.ts +10 -0
- package/cjs/min.d.ts.map +1 -0
- package/cjs/min.js +36 -0
- package/cjs/min.js.map +1 -0
- package/cjs/package.json +3 -0
- package/cjs/pow.d.ts +31 -0
- package/cjs/pow.d.ts.map +1 -0
- package/cjs/pow.js +36 -0
- package/cjs/pow.js.map +1 -0
- package/cjs/random.d.ts +93 -0
- package/cjs/random.d.ts.map +1 -0
- package/cjs/random.js +242 -0
- package/cjs/random.js.map +1 -0
- package/cjs/round.d.ts +9 -0
- package/cjs/round.d.ts.map +1 -0
- package/cjs/round.js +24 -0
- package/cjs/round.js.map +1 -0
- package/cjs/sign.d.ts +17 -0
- package/cjs/sign.d.ts.map +1 -0
- package/cjs/sign.js +22 -0
- package/cjs/sign.js.map +1 -0
- package/cjs/sin.d.ts +14 -0
- package/cjs/sin.d.ts.map +1 -0
- package/cjs/sin.js +31 -0
- package/cjs/sin.js.map +1 -0
- package/cjs/sinh.d.ts +14 -0
- package/cjs/sinh.d.ts.map +1 -0
- package/cjs/sinh.js +22 -0
- package/cjs/sinh.js.map +1 -0
- package/cjs/sqrt.d.ts +19 -0
- package/cjs/sqrt.d.ts.map +1 -0
- package/cjs/sqrt.js +45 -0
- package/cjs/sqrt.js.map +1 -0
- package/cjs/tan.d.ts +9 -0
- package/cjs/tan.d.ts.map +1 -0
- package/cjs/tan.js +26 -0
- package/cjs/tan.js.map +1 -0
- package/cjs/tanh.d.ts +17 -0
- package/cjs/tanh.d.ts.map +1 -0
- package/cjs/tanh.js +34 -0
- package/cjs/tanh.js.map +1 -0
- package/cjs/trunc.d.ts +21 -0
- package/cjs/trunc.d.ts.map +1 -0
- package/cjs/trunc.js +50 -0
- package/cjs/trunc.js.map +1 -0
- package/cjs/types/finite.d.ts +16 -0
- package/cjs/types/finite.d.ts.map +1 -0
- package/cjs/types/finite.js +4 -0
- package/cjs/types/finite.js.map +1 -0
- package/cjs/types/float.d.ts +65 -0
- package/cjs/types/float.d.ts.map +1 -0
- package/cjs/types/float.js +4 -0
- package/cjs/types/float.js.map +1 -0
- package/cjs/types/index.d.ts +6 -0
- package/cjs/types/index.d.ts.map +1 -0
- package/cjs/types/index.js +22 -0
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/integer.d.ts +147 -0
- package/cjs/types/integer.d.ts.map +1 -0
- package/cjs/types/integer.js +5 -0
- package/cjs/types/integer.js.map +1 -0
- package/cjs/types/precision.d.ts +46 -0
- package/cjs/types/precision.d.ts.map +1 -0
- package/cjs/types/precision.js +9 -0
- package/cjs/types/precision.js.map +1 -0
- package/cjs/types/safe_integer.d.ts +17 -0
- package/cjs/types/safe_integer.d.ts.map +1 -0
- package/cjs/types/safe_integer.js +5 -0
- package/cjs/types/safe_integer.js.map +1 -0
- package/esm/abs.d.ts +14 -0
- package/esm/abs.d.ts.map +1 -0
- package/esm/abs.js +19 -0
- package/esm/abs.js.map +1 -0
- package/esm/acos.d.ts +17 -0
- package/esm/acos.d.ts.map +1 -0
- package/esm/acos.js +24 -0
- package/esm/acos.js.map +1 -0
- package/esm/acosh.d.ts +11 -0
- package/esm/acosh.d.ts.map +1 -0
- package/esm/acosh.js +32 -0
- package/esm/acosh.js.map +1 -0
- package/esm/asin.d.ts +11 -0
- package/esm/asin.d.ts.map +1 -0
- package/esm/asin.js +25 -0
- package/esm/asin.js.map +1 -0
- package/esm/asinh.d.ts +9 -0
- package/esm/asinh.d.ts.map +1 -0
- package/esm/asinh.js +23 -0
- package/esm/asinh.js.map +1 -0
- package/esm/atan.d.ts +11 -0
- package/esm/atan.d.ts.map +1 -0
- package/esm/atan.js +62 -0
- package/esm/atan.js.map +1 -0
- package/esm/atan2.d.ts +12 -0
- package/esm/atan2.d.ts.map +1 -0
- package/esm/atan2.js +67 -0
- package/esm/atan2.js.map +1 -0
- package/esm/atanh.d.ts +11 -0
- package/esm/atanh.d.ts.map +1 -0
- package/esm/atanh.js +29 -0
- package/esm/atanh.js.map +1 -0
- package/esm/cbrt.d.ts +9 -0
- package/esm/cbrt.d.ts.map +1 -0
- package/esm/cbrt.js +23 -0
- package/esm/cbrt.js.map +1 -0
- package/esm/ceil.d.ts +15 -0
- package/esm/ceil.d.ts.map +1 -0
- package/esm/ceil.js +31 -0
- package/esm/ceil.js.map +1 -0
- package/esm/clamp.d.ts +15 -0
- package/esm/clamp.d.ts.map +1 -0
- package/esm/clamp.js +29 -0
- package/esm/clamp.js.map +1 -0
- package/esm/clz32.d.ts +20 -0
- package/esm/clz32.d.ts.map +1 -0
- package/esm/clz32.js +45 -0
- package/esm/clz32.js.map +1 -0
- package/esm/constants/e.d.ts +17 -0
- package/esm/constants/e.d.ts.map +1 -0
- package/esm/constants/e.js +16 -0
- package/esm/constants/e.js.map +1 -0
- package/esm/constants/epsilon.d.ts +24 -0
- package/esm/constants/epsilon.d.ts.map +1 -0
- package/esm/constants/epsilon.js +23 -0
- package/esm/constants/epsilon.js.map +1 -0
- package/esm/constants/index.d.ts +23 -0
- package/esm/constants/index.d.ts.map +1 -0
- package/esm/constants/index.js +23 -0
- package/esm/constants/index.js.map +1 -0
- package/esm/constants/infinity.d.ts +3 -0
- package/esm/constants/infinity.d.ts.map +1 -0
- package/esm/constants/infinity.js +3 -0
- package/esm/constants/infinity.js.map +1 -0
- package/esm/constants/ln10.d.ts +10 -0
- package/esm/constants/ln10.d.ts.map +1 -0
- package/esm/constants/ln10.js +9 -0
- package/esm/constants/ln10.js.map +1 -0
- package/esm/constants/ln2.d.ts +10 -0
- package/esm/constants/ln2.d.ts.map +1 -0
- package/esm/constants/ln2.js +9 -0
- package/esm/constants/ln2.js.map +1 -0
- package/esm/constants/log10e.d.ts +10 -0
- package/esm/constants/log10e.d.ts.map +1 -0
- package/esm/constants/log10e.js +9 -0
- package/esm/constants/log10e.js.map +1 -0
- package/esm/constants/log2e.d.ts +10 -0
- package/esm/constants/log2e.d.ts.map +1 -0
- package/esm/constants/log2e.js +9 -0
- package/esm/constants/log2e.js.map +1 -0
- package/esm/constants/max_safe_integer.d.ts +11 -0
- package/esm/constants/max_safe_integer.d.ts.map +1 -0
- package/esm/constants/max_safe_integer.js +10 -0
- package/esm/constants/max_safe_integer.js.map +1 -0
- package/esm/constants/max_value.d.ts +10 -0
- package/esm/constants/max_value.d.ts.map +1 -0
- package/esm/constants/max_value.js +9 -0
- package/esm/constants/max_value.js.map +1 -0
- package/esm/constants/min_safe_integer.d.ts +12 -0
- package/esm/constants/min_safe_integer.d.ts.map +1 -0
- package/esm/constants/min_safe_integer.js +11 -0
- package/esm/constants/min_safe_integer.js.map +1 -0
- package/esm/constants/min_value.d.ts +10 -0
- package/esm/constants/min_value.d.ts.map +1 -0
- package/esm/constants/min_value.js +9 -0
- package/esm/constants/min_value.js.map +1 -0
- package/esm/constants/nan.d.ts +47 -0
- package/esm/constants/nan.d.ts.map +1 -0
- package/esm/constants/nan.js +27 -0
- package/esm/constants/nan.js.map +1 -0
- package/esm/constants/negative_infinity.d.ts +28 -0
- package/esm/constants/negative_infinity.d.ts.map +1 -0
- package/esm/constants/negative_infinity.js +12 -0
- package/esm/constants/negative_infinity.js.map +1 -0
- package/esm/constants/negative_zero.d.ts +31 -0
- package/esm/constants/negative_zero.d.ts.map +1 -0
- package/esm/constants/negative_zero.js +18 -0
- package/esm/constants/negative_zero.js.map +1 -0
- package/esm/constants/pi.d.ts +10 -0
- package/esm/constants/pi.d.ts.map +1 -0
- package/esm/constants/pi.js +9 -0
- package/esm/constants/pi.js.map +1 -0
- package/esm/constants/positive_infinity.d.ts +29 -0
- package/esm/constants/positive_infinity.d.ts.map +1 -0
- package/esm/constants/positive_infinity.js +13 -0
- package/esm/constants/positive_infinity.js.map +1 -0
- package/esm/constants/positive_zero.d.ts +38 -0
- package/esm/constants/positive_zero.d.ts.map +1 -0
- package/esm/constants/positive_zero.js +33 -0
- package/esm/constants/positive_zero.js.map +1 -0
- package/esm/constants/sqrt1_2.d.ts +9 -0
- package/esm/constants/sqrt1_2.d.ts.map +1 -0
- package/esm/constants/sqrt1_2.js +8 -0
- package/esm/constants/sqrt1_2.js.map +1 -0
- package/esm/constants/sqrt2.d.ts +9 -0
- package/esm/constants/sqrt2.d.ts.map +1 -0
- package/esm/constants/sqrt2.js +8 -0
- package/esm/constants/sqrt2.js.map +1 -0
- package/esm/cos.d.ts +10 -0
- package/esm/cos.d.ts.map +1 -0
- package/esm/cos.js +29 -0
- package/esm/cos.js.map +1 -0
- package/esm/cosh.d.ts +10 -0
- package/esm/cosh.d.ts.map +1 -0
- package/esm/cosh.js +18 -0
- package/esm/cosh.js.map +1 -0
- package/esm/exp.d.ts +20 -0
- package/esm/exp.d.ts.map +1 -0
- package/esm/exp.js +45 -0
- package/esm/exp.js.map +1 -0
- package/esm/expm1.d.ts +11 -0
- package/esm/expm1.d.ts.map +1 -0
- package/esm/expm1.js +35 -0
- package/esm/expm1.js.map +1 -0
- package/esm/f16round.d.ts +24 -0
- package/esm/f16round.d.ts.map +1 -0
- package/esm/f16round.js +39 -0
- package/esm/f16round.js.map +1 -0
- package/esm/float16/constants.d.ts +97 -0
- package/esm/float16/constants.d.ts.map +1 -0
- package/esm/float16/constants.js +96 -0
- package/esm/float16/constants.js.map +1 -0
- package/esm/float16/decode.d.ts +40 -0
- package/esm/float16/decode.d.ts.map +1 -0
- package/esm/float16/decode.js +61 -0
- package/esm/float16/decode.js.map +1 -0
- package/esm/float16/encode.d.ts +67 -0
- package/esm/float16/encode.d.ts.map +1 -0
- package/esm/float16/encode.js +71 -0
- package/esm/float16/encode.js.map +1 -0
- package/esm/float16/guards.d.ts +22 -0
- package/esm/float16/guards.d.ts.map +1 -0
- package/esm/float16/guards.js +12 -0
- package/esm/float16/guards.js.map +1 -0
- package/esm/float16/index.d.ts +11 -0
- package/esm/float16/index.d.ts.map +1 -0
- package/esm/float16/index.js +11 -0
- package/esm/float16/index.js.map +1 -0
- package/esm/float16/round.d.ts +25 -0
- package/esm/float16/round.d.ts.map +1 -0
- package/esm/float16/round.js +43 -0
- package/esm/float16/round.js.map +1 -0
- package/esm/float32/constants.d.ts +96 -0
- package/esm/float32/constants.d.ts.map +1 -0
- package/esm/float32/constants.js +95 -0
- package/esm/float32/constants.js.map +1 -0
- package/esm/float32/decode.d.ts +38 -0
- package/esm/float32/decode.d.ts.map +1 -0
- package/esm/float32/decode.js +64 -0
- package/esm/float32/decode.js.map +1 -0
- package/esm/float32/encode.d.ts +50 -0
- package/esm/float32/encode.d.ts.map +1 -0
- package/esm/float32/encode.js +71 -0
- package/esm/float32/encode.js.map +1 -0
- package/esm/float32/guards.d.ts +37 -0
- package/esm/float32/guards.d.ts.map +1 -0
- package/esm/float32/guards.js +16 -0
- package/esm/float32/guards.js.map +1 -0
- package/esm/float32/index.d.ts +11 -0
- package/esm/float32/index.d.ts.map +1 -0
- package/esm/float32/index.js +11 -0
- package/esm/float32/index.js.map +1 -0
- package/esm/float32/round.d.ts +23 -0
- package/esm/float32/round.d.ts.map +1 -0
- package/esm/float32/round.js +33 -0
- package/esm/float32/round.js.map +1 -0
- package/esm/floor.d.ts +10 -0
- package/esm/floor.d.ts.map +1 -0
- package/esm/floor.js +29 -0
- package/esm/floor.js.map +1 -0
- package/esm/fround.d.ts +23 -0
- package/esm/fround.d.ts.map +1 -0
- package/esm/fround.js +32 -0
- package/esm/fround.js.map +1 -0
- package/esm/guards/finite.d.ts +23 -0
- package/esm/guards/finite.d.ts.map +1 -0
- package/esm/guards/finite.js +18 -0
- package/esm/guards/finite.js.map +1 -0
- package/esm/guards/index.d.ts +50 -0
- package/esm/guards/index.d.ts.map +1 -0
- package/esm/guards/index.js +50 -0
- package/esm/guards/index.js.map +1 -0
- package/esm/guards/infinity.d.ts +3 -0
- package/esm/guards/infinity.d.ts.map +1 -0
- package/esm/guards/infinity.js +3 -0
- package/esm/guards/infinity.js.map +1 -0
- package/esm/guards/integer.d.ts +47 -0
- package/esm/guards/integer.d.ts.map +1 -0
- package/esm/guards/integer.js +19 -0
- package/esm/guards/integer.js.map +1 -0
- package/esm/guards/nan.d.ts +61 -0
- package/esm/guards/nan.d.ts.map +1 -0
- package/esm/guards/nan.js +63 -0
- package/esm/guards/nan.js.map +1 -0
- package/esm/guards/negative_infinity.d.ts +19 -0
- package/esm/guards/negative_infinity.d.ts.map +1 -0
- package/esm/guards/negative_infinity.js +21 -0
- package/esm/guards/negative_infinity.js.map +1 -0
- package/esm/guards/negative_zero.d.ts +12 -0
- package/esm/guards/negative_zero.d.ts.map +1 -0
- package/esm/guards/negative_zero.js +20 -0
- package/esm/guards/negative_zero.js.map +1 -0
- package/esm/guards/positive_infinity.d.ts +19 -0
- package/esm/guards/positive_infinity.d.ts.map +1 -0
- package/esm/guards/positive_infinity.js +21 -0
- package/esm/guards/positive_infinity.js.map +1 -0
- package/esm/guards/positive_zero.d.ts +17 -0
- package/esm/guards/positive_zero.d.ts.map +1 -0
- package/esm/guards/positive_zero.js +19 -0
- package/esm/guards/positive_zero.js.map +1 -0
- package/esm/guards/safe_integer.d.ts +33 -0
- package/esm/guards/safe_integer.d.ts.map +1 -0
- package/esm/guards/safe_integer.js +22 -0
- package/esm/guards/safe_integer.js.map +1 -0
- package/esm/hypot.d.ts +18 -0
- package/esm/hypot.d.ts.map +1 -0
- package/esm/hypot.js +60 -0
- package/esm/hypot.js.map +1 -0
- package/esm/ieee754.d.ts +16 -0
- package/esm/ieee754.d.ts.map +1 -0
- package/esm/ieee754.js +16 -0
- package/esm/ieee754.js.map +1 -0
- package/esm/imul.d.ts +17 -0
- package/esm/imul.d.ts.map +1 -0
- package/esm/imul.js +21 -0
- package/esm/imul.js.map +1 -0
- package/esm/index.d.ts +84 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +84 -0
- package/esm/index.js.map +1 -0
- package/esm/internal/ieee754.d.ts +174 -0
- package/esm/internal/ieee754.d.ts.map +1 -0
- package/esm/internal/ieee754.js +194 -0
- package/esm/internal/ieee754.js.map +1 -0
- package/esm/internal/primordials.d.ts +30 -0
- package/esm/internal/primordials.d.ts.map +1 -0
- package/esm/internal/primordials.js +27 -0
- package/esm/internal/primordials.js.map +1 -0
- package/esm/log.d.ts +9 -0
- package/esm/log.d.ts.map +1 -0
- package/esm/log.js +43 -0
- package/esm/log.js.map +1 -0
- package/esm/log10.d.ts +9 -0
- package/esm/log10.d.ts.map +1 -0
- package/esm/log10.js +18 -0
- package/esm/log10.js.map +1 -0
- package/esm/log1p.d.ts +10 -0
- package/esm/log1p.d.ts.map +1 -0
- package/esm/log1p.js +29 -0
- package/esm/log1p.js.map +1 -0
- package/esm/log2.d.ts +12 -0
- package/esm/log2.d.ts.map +1 -0
- package/esm/log2.js +21 -0
- package/esm/log2.js.map +1 -0
- package/esm/max.d.ts +22 -0
- package/esm/max.d.ts.map +1 -0
- package/esm/max.js +48 -0
- package/esm/max.js.map +1 -0
- package/esm/min.d.ts +10 -0
- package/esm/min.d.ts.map +1 -0
- package/esm/min.js +33 -0
- package/esm/min.js.map +1 -0
- package/esm/package.json +3 -0
- package/esm/pow.d.ts +31 -0
- package/esm/pow.d.ts.map +1 -0
- package/esm/pow.js +33 -0
- package/esm/pow.js.map +1 -0
- package/esm/random.d.ts +93 -0
- package/esm/random.d.ts.map +1 -0
- package/esm/random.js +237 -0
- package/esm/random.js.map +1 -0
- package/esm/round.d.ts +9 -0
- package/esm/round.d.ts.map +1 -0
- package/esm/round.js +21 -0
- package/esm/round.js.map +1 -0
- package/esm/sign.d.ts +17 -0
- package/esm/sign.d.ts.map +1 -0
- package/esm/sign.js +19 -0
- package/esm/sign.js.map +1 -0
- package/esm/sin.d.ts +14 -0
- package/esm/sin.d.ts.map +1 -0
- package/esm/sin.js +28 -0
- package/esm/sin.js.map +1 -0
- package/esm/sinh.d.ts +14 -0
- package/esm/sinh.d.ts.map +1 -0
- package/esm/sinh.js +19 -0
- package/esm/sinh.js.map +1 -0
- package/esm/sqrt.d.ts +19 -0
- package/esm/sqrt.d.ts.map +1 -0
- package/esm/sqrt.js +42 -0
- package/esm/sqrt.js.map +1 -0
- package/esm/tan.d.ts +9 -0
- package/esm/tan.d.ts.map +1 -0
- package/esm/tan.js +23 -0
- package/esm/tan.js.map +1 -0
- package/esm/tanh.d.ts +17 -0
- package/esm/tanh.d.ts.map +1 -0
- package/esm/tanh.js +31 -0
- package/esm/tanh.js.map +1 -0
- package/esm/trunc.d.ts +21 -0
- package/esm/trunc.d.ts.map +1 -0
- package/esm/trunc.js +47 -0
- package/esm/trunc.js.map +1 -0
- package/esm/types/finite.d.ts +16 -0
- package/esm/types/finite.d.ts.map +1 -0
- package/esm/types/finite.js +3 -0
- package/esm/types/finite.js.map +1 -0
- package/esm/types/float.d.ts +65 -0
- package/esm/types/float.d.ts.map +1 -0
- package/esm/types/float.js +3 -0
- package/esm/types/float.js.map +1 -0
- package/esm/types/index.d.ts +6 -0
- package/esm/types/index.d.ts.map +1 -0
- package/esm/types/index.js +6 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/integer.d.ts +147 -0
- package/esm/types/integer.d.ts.map +1 -0
- package/esm/types/integer.js +4 -0
- package/esm/types/integer.js.map +1 -0
- package/esm/types/precision.d.ts +46 -0
- package/esm/types/precision.d.ts.map +1 -0
- package/esm/types/precision.js +8 -0
- package/esm/types/precision.js.map +1 -0
- package/esm/types/safe_integer.d.ts +17 -0
- package/esm/types/safe_integer.d.ts.map +1 -0
- package/esm/types/safe_integer.js +4 -0
- package/esm/types/safe_integer.js.map +1 -0
- package/package.json +1834 -0
- package/src/abs.ts +18 -0
- package/src/acos.ts +24 -0
- package/src/acosh.ts +28 -0
- package/src/asin.ts +24 -0
- package/src/asinh.ts +21 -0
- package/src/atan.ts +64 -0
- package/src/atan2.ts +58 -0
- package/src/atanh.ts +26 -0
- package/src/cbrt.ts +22 -0
- package/src/ceil.ts +27 -0
- package/src/clamp.ts +29 -0
- package/src/clz32.ts +45 -0
- package/src/constants/e.ts +18 -0
- package/src/constants/epsilon.ts +25 -0
- package/src/constants/index.ts +22 -0
- package/src/constants/infinity.ts +2 -0
- package/src/constants/ln10.ts +9 -0
- package/src/constants/ln2.ts +9 -0
- package/src/constants/log10e.ts +9 -0
- package/src/constants/log2e.ts +9 -0
- package/src/constants/max_safe_integer.ts +10 -0
- package/src/constants/max_value.ts +9 -0
- package/src/constants/min_safe_integer.ts +11 -0
- package/src/constants/min_value.ts +9 -0
- package/src/constants/nan.ts +57 -0
- package/src/constants/negative_infinity.ts +28 -0
- package/src/constants/negative_zero.ts +34 -0
- package/src/constants/pi.ts +9 -0
- package/src/constants/positive_infinity.ts +30 -0
- package/src/constants/positive_zero.ts +41 -0
- package/src/constants/sqrt1_2.ts +8 -0
- package/src/constants/sqrt2.ts +8 -0
- package/src/cos.ts +29 -0
- package/src/cosh.ts +18 -0
- package/src/exp.ts +45 -0
- package/src/expm1.ts +31 -0
- package/src/f16round.ts +39 -0
- package/src/float16/constants.ts +106 -0
- package/src/float16/decode.ts +61 -0
- package/src/float16/encode.ts +72 -0
- package/src/float16/guards.ts +33 -0
- package/src/float16/index.ts +10 -0
- package/src/float16/round.ts +43 -0
- package/src/float32/constants.ts +105 -0
- package/src/float32/decode.ts +64 -0
- package/src/float32/encode.ts +71 -0
- package/src/float32/guards.ts +54 -0
- package/src/float32/index.ts +10 -0
- package/src/float32/round.ts +33 -0
- package/src/floor.ts +26 -0
- package/src/fround.ts +32 -0
- package/src/guards/finite.ts +45 -0
- package/src/guards/index.ts +49 -0
- package/src/guards/infinity.ts +2 -0
- package/src/guards/integer.ts +62 -0
- package/src/guards/nan.ts +65 -0
- package/src/guards/negative_infinity.ts +22 -0
- package/src/guards/negative_zero.ts +21 -0
- package/src/guards/positive_infinity.ts +22 -0
- package/src/guards/positive_zero.ts +19 -0
- package/src/guards/safe_integer.ts +56 -0
- package/src/hypot.ts +59 -0
- package/src/ieee754.ts +15 -0
- package/src/imul.ts +21 -0
- package/src/index.ts +84 -0
- package/src/internal/ieee754.ts +255 -0
- package/src/internal/primordials.ts +33 -0
- package/src/log.ts +42 -0
- package/src/log10.ts +18 -0
- package/src/log1p.ts +26 -0
- package/src/log2.ts +21 -0
- package/src/max.ts +46 -0
- package/src/min.ts +32 -0
- package/src/pow.ts +33 -0
- package/src/random.ts +241 -0
- package/src/round.ts +20 -0
- package/src/sign.ts +19 -0
- package/src/sin.ts +29 -0
- package/src/sinh.ts +19 -0
- package/src/sqrt.ts +40 -0
- package/src/tan.ts +22 -0
- package/src/tanh.ts +28 -0
- package/src/trunc.ts +44 -0
- package/src/types/finite.ts +23 -0
- package/src/types/float.ts +74 -0
- package/src/types/index.ts +5 -0
- package/src/types/integer.ts +167 -0
- package/src/types/precision.ts +51 -0
- package/src/types/safe_integer.ts +18 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Not a Number (`NaN`) is a special value representing all values which are
|
|
4
|
+
* not valid numbers. It is approximately equal to `0 / 0`, meaning it is a
|
|
5
|
+
* non-representable, non-finite, non-zero result of an invalid math operation.
|
|
6
|
+
*
|
|
7
|
+
* `NaN` is the only value in JavaScript which is not less than, greater than,
|
|
8
|
+
* nor equal to any other value, including itself. It is the result of invalid
|
|
9
|
+
* mathematical operations, such as dividing zero by zero, or parsing a string
|
|
10
|
+
* that does not represent a valid number with `parseInt` or `parseFloat`.
|
|
11
|
+
*
|
|
12
|
+
* @module nan
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.NaN = exports.NAN = void 0;
|
|
16
|
+
// purposely kept private and local to this module only, preventing external
|
|
17
|
+
// code from imitating the `NaN` type below.
|
|
18
|
+
const Not_a_Number = Symbol("Is_NaN");
|
|
19
|
+
/**
|
|
20
|
+
* Represents the special value "Not a Number" (`NaN`), which is used to denote
|
|
21
|
+
* an invalid number. It is approximately equivalent to `0 / 0`.
|
|
22
|
+
*
|
|
23
|
+
* This is a local implementation of the native `Number.NaN` constant.
|
|
24
|
+
*
|
|
25
|
+
* @category Constants
|
|
26
|
+
* @tags Number, NaN
|
|
27
|
+
*/
|
|
28
|
+
exports.NAN = 0 / 0;
|
|
29
|
+
exports.NaN = exports.NAN;
|
|
30
|
+
//# sourceMappingURL=nan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nan.js","sourceRoot":"","sources":["../../src/constants/nan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,4EAA4E;AAC5E,4CAA4C;AAC5C,MAAM,YAAY,GAAkB,MAAM,CAAC,QAAQ,CAAC,CAAC;AAwBrD;;;;;;;;GAQG;AACU,QAAA,GAAG,GAAQ,CAAC,GAAG,CAAQ,CAAC;AAQrB,cARH,WAAG,CAQG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Negative Infinity is a special value representing negative infinity, which
|
|
3
|
+
* is less than any other number. It is approximately equal to
|
|
4
|
+
* `-1.7976931348623159e+308`.
|
|
5
|
+
*
|
|
6
|
+
* This is a local implementation of the native `Number.NEGATIVE_INFINITY`
|
|
7
|
+
* constant.
|
|
8
|
+
* @category Constants
|
|
9
|
+
* @tags Infinity
|
|
10
|
+
*/
|
|
11
|
+
export declare const NEGATIVE_INFINITY: NEGATIVE_INFINITY;
|
|
12
|
+
/**
|
|
13
|
+
* Special type used to represent `-Infinity` (negative infinity). TypeScript's
|
|
14
|
+
* built-in types do not distinguish between positive/negative infinity and any
|
|
15
|
+
* other `number`. However, its type checker _is_ capable of differentiating
|
|
16
|
+
* between those types and other literal numbers.
|
|
17
|
+
*
|
|
18
|
+
* This type simply (ab)uses the type system's handling of scientific notation:
|
|
19
|
+
* by using an arbitrary exponent in excess of `308`, the type checker can now
|
|
20
|
+
* recognize and represent the type as `Infinity`. Great success!
|
|
21
|
+
*
|
|
22
|
+
* NB: Credit to Sindre Sorhus and his type-fest project for this approach.
|
|
23
|
+
*
|
|
24
|
+
* @category Types
|
|
25
|
+
* @tags Infinity
|
|
26
|
+
*/
|
|
27
|
+
export type NEGATIVE_INFINITY = -1e333;
|
|
28
|
+
//# sourceMappingURL=negative_infinity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negative_infinity.d.ts","sourceRoot":"","sources":["../../src/constants/negative_infinity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAA+C,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NEGATIVE_INFINITY = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Negative Infinity is a special value representing negative infinity, which
|
|
6
|
+
* is less than any other number. It is approximately equal to
|
|
7
|
+
* `-1.7976931348623159e+308`.
|
|
8
|
+
*
|
|
9
|
+
* This is a local implementation of the native `Number.NEGATIVE_INFINITY`
|
|
10
|
+
* constant.
|
|
11
|
+
* @category Constants
|
|
12
|
+
* @tags Infinity
|
|
13
|
+
*/
|
|
14
|
+
exports.NEGATIVE_INFINITY = -1 / 0;
|
|
15
|
+
//# sourceMappingURL=negative_infinity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negative_infinity.js","sourceRoot":"","sources":["../../src/constants/negative_infinity.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAsB,CAAC,CAAC,GAAG,CAAsB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module provides a constant value and a branded nominal type for the
|
|
3
|
+
* special number negative zero (`-0`). This is a non-standard extension of the
|
|
4
|
+
* native JavaScript language, provided for stronger type-safety when working
|
|
5
|
+
* with negative zero values.
|
|
6
|
+
*
|
|
7
|
+
* @module negative-zero
|
|
8
|
+
*/
|
|
9
|
+
declare const NegativeZero: unique symbol;
|
|
10
|
+
interface NegativeZero {
|
|
11
|
+
readonly [NegativeZero]: never;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents the special number negative zero (`-0`).
|
|
15
|
+
*
|
|
16
|
+
* @category Constants
|
|
17
|
+
* @tags Negative Zero
|
|
18
|
+
*/
|
|
19
|
+
export declare const NEGATIVE_ZERO: NEGATIVE_ZERO;
|
|
20
|
+
/**
|
|
21
|
+
* @remarks
|
|
22
|
+
* TypeScript is not capable of distinguishing `-0` from `0` on a type level.
|
|
23
|
+
* This type helps fill that gap by providing a branded nominal type for it,
|
|
24
|
+
* allowing you to perform strict type checking and narrowing against negative
|
|
25
|
+
* zero values.
|
|
26
|
+
*
|
|
27
|
+
* @see {@linkcode isNegativeZero} to check runtime values against this type.
|
|
28
|
+
*/
|
|
29
|
+
export type NEGATIVE_ZERO = -0 & NegativeZero;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=negative_zero.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negative_zero.d.ts","sourceRoot":"","sources":["../../src/constants/negative_zero.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,QAAA,MAAM,YAAY,EAAE,OAAO,MAAqB,CAAC;AAEjD,UAAU,YAAY;IACpB,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC;CAChC;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,aAAmC,CAAC;AAEhE;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This module provides a constant value and a branded nominal type for the
|
|
4
|
+
* special number negative zero (`-0`). This is a non-standard extension of the
|
|
5
|
+
* native JavaScript language, provided for stronger type-safety when working
|
|
6
|
+
* with negative zero values.
|
|
7
|
+
*
|
|
8
|
+
* @module negative-zero
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.NEGATIVE_ZERO = void 0;
|
|
12
|
+
// deno-lint-ignore no-unused-vars
|
|
13
|
+
const NegativeZero = Symbol("-0");
|
|
14
|
+
/**
|
|
15
|
+
* Represents the special number negative zero (`-0`).
|
|
16
|
+
*
|
|
17
|
+
* @category Constants
|
|
18
|
+
* @tags Negative Zero
|
|
19
|
+
*/
|
|
20
|
+
exports.NEGATIVE_ZERO = -0;
|
|
21
|
+
//# sourceMappingURL=negative_zero.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negative_zero.js","sourceRoot":"","sources":["../../src/constants/negative_zero.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,kCAAkC;AAClC,MAAM,YAAY,GAAkB,MAAM,CAAC,IAAI,CAAC,CAAC;AAMjD;;;;;GAKG;AACU,QAAA,aAAa,GAAkB,CAAC,CAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the mathematical constant `π` (pi), the ratio of a circle's
|
|
3
|
+
* circumference to its diameter, approximately equal to `3.141592653589793`.
|
|
4
|
+
*
|
|
5
|
+
* This is a local implementation of the native `Math.PI` constant.
|
|
6
|
+
* @category Constants
|
|
7
|
+
*/
|
|
8
|
+
export declare const PI: PI;
|
|
9
|
+
export type PI = 3.141592653589793;
|
|
10
|
+
//# sourceMappingURL=pi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../src/constants/pi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,EAAE,EAAE,EAAsB,CAAC;AACxC,MAAM,MAAM,EAAE,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PI = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Represents the mathematical constant `π` (pi), the ratio of a circle's
|
|
6
|
+
* circumference to its diameter, approximately equal to `3.141592653589793`.
|
|
7
|
+
*
|
|
8
|
+
* This is a local implementation of the native `Math.PI` constant.
|
|
9
|
+
* @category Constants
|
|
10
|
+
*/
|
|
11
|
+
exports.PI = 3.141592653589793;
|
|
12
|
+
//# sourceMappingURL=pi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../src/constants/pi.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACU,QAAA,EAAE,GAAO,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Positive Infinity is a special value representing positive infinity, which
|
|
3
|
+
* is greater than any other number. It is approximately equal to
|
|
4
|
+
* `1.7976931348623159e+308`.
|
|
5
|
+
*
|
|
6
|
+
* This is a local implementation of the native `Number.POSITIVE_INFINITY`
|
|
7
|
+
* constant.
|
|
8
|
+
* @category Constants
|
|
9
|
+
* @tags Infinity
|
|
10
|
+
*/
|
|
11
|
+
export declare const POSITIVE_INFINITY: POSITIVE_INFINITY;
|
|
12
|
+
/**
|
|
13
|
+
* Special type used to represent `+Infinity` (positive infinity). TypeScript's
|
|
14
|
+
* built-in types do not distinguish between positive/negative infinity and any
|
|
15
|
+
* other `number`. However, its type checker _is_ capable of differentiating
|
|
16
|
+
* between those types and other literal numbers.
|
|
17
|
+
*
|
|
18
|
+
* This type simply (ab)uses the type system's handling of scientific notation:
|
|
19
|
+
* by using an arbitrary exponent in excess of `308`, the type checker can now
|
|
20
|
+
* recognize and represent the type as `Infinity`. Great success!
|
|
21
|
+
*
|
|
22
|
+
* NB: Credit to Sindre Sorhus and his type-fest project for this approach.
|
|
23
|
+
*
|
|
24
|
+
* @category Types
|
|
25
|
+
* @tags Infinity
|
|
26
|
+
*/
|
|
27
|
+
export type POSITIVE_INFINITY = 1e333;
|
|
28
|
+
export { POSITIVE_INFINITY as Infinity };
|
|
29
|
+
//# sourceMappingURL=positive_infinity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positive_infinity.d.ts","sourceRoot":"","sources":["../../src/constants/positive_infinity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAA8C,CAAC;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEtC,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Infinity = exports.POSITIVE_INFINITY = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Positive Infinity is a special value representing positive infinity, which
|
|
6
|
+
* is greater than any other number. It is approximately equal to
|
|
7
|
+
* `1.7976931348623159e+308`.
|
|
8
|
+
*
|
|
9
|
+
* This is a local implementation of the native `Number.POSITIVE_INFINITY`
|
|
10
|
+
* constant.
|
|
11
|
+
* @category Constants
|
|
12
|
+
* @tags Infinity
|
|
13
|
+
*/
|
|
14
|
+
exports.POSITIVE_INFINITY = 1 / 0;
|
|
15
|
+
exports.Infinity = exports.POSITIVE_INFINITY;
|
|
16
|
+
//# sourceMappingURL=positive_infinity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positive_infinity.js","sourceRoot":"","sources":["../../src/constants/positive_infinity.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAsB,CAAC,GAAG,CAAsB,CAAC;AAmBjD,mBAnBjB,yBAAiB,CAmBQ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module provides a constant value and a branded nominal type for the
|
|
3
|
+
* special number positive zero (`-0`). This is a non-standard extension of the
|
|
4
|
+
* native JavaScript language, provided for stronger type-safety when working
|
|
5
|
+
* with positive zero values.
|
|
6
|
+
*
|
|
7
|
+
* @module positive-zero
|
|
8
|
+
*/
|
|
9
|
+
declare const PositiveZero: unique symbol;
|
|
10
|
+
interface PositiveZero {
|
|
11
|
+
readonly [PositiveZero]: never;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents a value that has been verified at runtime to be positive zero,
|
|
15
|
+
* (i.e. exactly `0`, and not `-0`).
|
|
16
|
+
*
|
|
17
|
+
* This is provided as both a constant runtime value and as a branded nominal
|
|
18
|
+
* type alias for `0`, for use in type-level checks and narrowing where you
|
|
19
|
+
* need a higher level of type-safety than just a standard literal `0`.
|
|
20
|
+
*
|
|
21
|
+
* @category Constants
|
|
22
|
+
* @tags Positive Zero
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { POSITIVE_ZERO } from "@nick/math/constants/positive-zero";
|
|
26
|
+
* import { isPositiveZero } from "@nick/math/is/positive-zero";
|
|
27
|
+
* import assert from "node:assert";
|
|
28
|
+
*
|
|
29
|
+
* assert.strictEqual(isPositiveZero(-0), false); // OK
|
|
30
|
+
* assert.strictEqual(isPositiveZero(POSITIVE_ZERO), true); // OK
|
|
31
|
+
* assert.strictEqual(POSITIVE_ZERO, 0); // OK
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const POSITIVE_ZERO: POSITIVE_ZERO;
|
|
35
|
+
/** @inheritdoc */
|
|
36
|
+
export type POSITIVE_ZERO = 0 & PositiveZero;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=positive_zero.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positive_zero.d.ts","sourceRoot":"","sources":["../../src/constants/positive_zero.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,QAAA,MAAM,YAAY,EAAE,OAAO,MAAoB,CAAC;AAEhD,UAAU,YAAY;IACpB,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,EAAE,aAAkC,CAAC;AAE/D,kBAAkB;AAClB,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This module provides a constant value and a branded nominal type for the
|
|
4
|
+
* special number positive zero (`-0`). This is a non-standard extension of the
|
|
5
|
+
* native JavaScript language, provided for stronger type-safety when working
|
|
6
|
+
* with positive zero values.
|
|
7
|
+
*
|
|
8
|
+
* @module positive-zero
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.POSITIVE_ZERO = void 0;
|
|
12
|
+
// deno-lint-ignore no-unused-vars
|
|
13
|
+
const PositiveZero = Symbol("0");
|
|
14
|
+
/**
|
|
15
|
+
* Represents a value that has been verified at runtime to be positive zero,
|
|
16
|
+
* (i.e. exactly `0`, and not `-0`).
|
|
17
|
+
*
|
|
18
|
+
* This is provided as both a constant runtime value and as a branded nominal
|
|
19
|
+
* type alias for `0`, for use in type-level checks and narrowing where you
|
|
20
|
+
* need a higher level of type-safety than just a standard literal `0`.
|
|
21
|
+
*
|
|
22
|
+
* @category Constants
|
|
23
|
+
* @tags Positive Zero
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { POSITIVE_ZERO } from "@nick/math/constants/positive-zero";
|
|
27
|
+
* import { isPositiveZero } from "@nick/math/is/positive-zero";
|
|
28
|
+
* import assert from "node:assert";
|
|
29
|
+
*
|
|
30
|
+
* assert.strictEqual(isPositiveZero(-0), false); // OK
|
|
31
|
+
* assert.strictEqual(isPositiveZero(POSITIVE_ZERO), true); // OK
|
|
32
|
+
* assert.strictEqual(POSITIVE_ZERO, 0); // OK
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
exports.POSITIVE_ZERO = 0;
|
|
36
|
+
//# sourceMappingURL=positive_zero.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positive_zero.js","sourceRoot":"","sources":["../../src/constants/positive_zero.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,kCAAkC;AAClC,MAAM,YAAY,GAAkB,MAAM,CAAC,GAAG,CAAC,CAAC;AAMhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACU,QAAA,aAAa,GAAkB,CAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The square root of `1/2`, approximately equal to `0.7071067811865476`.
|
|
3
|
+
*
|
|
4
|
+
* This is a local implementation of the native `Math.SQRT1_2` constant.
|
|
5
|
+
* @category Constants
|
|
6
|
+
*/
|
|
7
|
+
export declare const SQRT1_2: SQRT1_2;
|
|
8
|
+
export type SQRT1_2 = 0.7071067811865476;
|
|
9
|
+
//# sourceMappingURL=sqrt1_2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqrt1_2.d.ts","sourceRoot":"","sources":["../../src/constants/sqrt1_2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,OAA4B,CAAC;AACnD,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SQRT1_2 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The square root of `1/2`, approximately equal to `0.7071067811865476`.
|
|
6
|
+
*
|
|
7
|
+
* This is a local implementation of the native `Math.SQRT1_2` constant.
|
|
8
|
+
* @category Constants
|
|
9
|
+
*/
|
|
10
|
+
exports.SQRT1_2 = 0.7071067811865476;
|
|
11
|
+
//# sourceMappingURL=sqrt1_2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqrt1_2.js","sourceRoot":"","sources":["../../src/constants/sqrt1_2.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACU,QAAA,OAAO,GAAY,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The square root of `2`, approximately equal to `1.4142135623730951`.
|
|
3
|
+
*
|
|
4
|
+
* This is a local implementation of the native `Math.SQRT2` constant.
|
|
5
|
+
* @category Constants
|
|
6
|
+
*/
|
|
7
|
+
export declare const SQRT2: SQRT2;
|
|
8
|
+
export type SQRT2 = 1.4142135623730951;
|
|
9
|
+
//# sourceMappingURL=sqrt2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqrt2.d.ts","sourceRoot":"","sources":["../../src/constants/sqrt2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAA0B,CAAC;AAC/C,MAAM,MAAM,KAAK,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SQRT2 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The square root of `2`, approximately equal to `1.4142135623730951`.
|
|
6
|
+
*
|
|
7
|
+
* This is a local implementation of the native `Math.SQRT2` constant.
|
|
8
|
+
* @category Constants
|
|
9
|
+
*/
|
|
10
|
+
exports.SQRT2 = 1.4142135623730951;
|
|
11
|
+
//# sourceMappingURL=sqrt2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqrt2.js","sourceRoot":"","sources":["../../src/constants/sqrt2.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACU,QAAA,KAAK,GAAU,kBAAkB,CAAC"}
|
package/cjs/cos.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the cosine of a number, returning a value in the range `[-1, 1]`.
|
|
3
|
+
*
|
|
4
|
+
* @param x The angle in radians whose cosine is to be calculated.
|
|
5
|
+
* @returns The cosine of the provided angle.
|
|
6
|
+
* @category Trigonometry
|
|
7
|
+
* @tags cosine
|
|
8
|
+
*/
|
|
9
|
+
export declare function cos(x: number): number;
|
|
10
|
+
//# sourceMappingURL=cos.d.ts.map
|
package/cjs/cos.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cos.d.ts","sourceRoot":"","sources":["../src/cos.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAUrC"}
|
package/cjs/cos.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cos = cos;
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the cosine of a number, returning a value in the range `[-1, 1]`.
|
|
6
|
+
*
|
|
7
|
+
* @module cos
|
|
8
|
+
*/
|
|
9
|
+
const abs_js_1 = require("./abs.js");
|
|
10
|
+
const epsilon_js_1 = require("./constants/epsilon.js");
|
|
11
|
+
const nan_js_1 = require("./constants/nan.js");
|
|
12
|
+
const finite_js_1 = require("./guards/finite.js");
|
|
13
|
+
/**
|
|
14
|
+
* Calculates the cosine of a number, returning a value in the range `[-1, 1]`.
|
|
15
|
+
*
|
|
16
|
+
* @param x The angle in radians whose cosine is to be calculated.
|
|
17
|
+
* @returns The cosine of the provided angle.
|
|
18
|
+
* @category Trigonometry
|
|
19
|
+
* @tags cosine
|
|
20
|
+
*/
|
|
21
|
+
function cos(x) {
|
|
22
|
+
if (!(0, finite_js_1.isFinite)(x))
|
|
23
|
+
return nan_js_1.NAN;
|
|
24
|
+
let sum = 1, term = 1, n = 0;
|
|
25
|
+
while ((0, abs_js_1.abs)(term) > epsilon_js_1.EPSILON) {
|
|
26
|
+
n += 2;
|
|
27
|
+
term *= -x * x / (n * (n - 1));
|
|
28
|
+
sum += term;
|
|
29
|
+
}
|
|
30
|
+
return sum;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=cos.js.map
|
package/cjs/cos.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cos.js","sourceRoot":"","sources":["../src/cos.ts"],"names":[],"mappings":";;AAkBA,kBAUC;AA5BD;;;;GAIG;AACH,qCAA+B;AAC/B,uDAAiD;AACjD,+CAAyC;AACzC,kDAA8C;AAE9C;;;;;;;GAOG;AACH,SAAgB,GAAG,CAAC,CAAS;IAC3B,IAAI,CAAC,IAAA,oBAAQ,EAAC,CAAC,CAAC;QAAE,OAAO,YAAG,CAAC;IAE7B,IAAI,GAAG,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,IAAA,YAAG,EAAC,IAAI,CAAC,GAAG,oBAAO,EAAE,CAAC;QAC3B,CAAC,IAAI,CAAC,CAAC;QACP,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/B,GAAG,IAAI,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/cjs/cosh.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the hyperbolic cosine of a number.
|
|
3
|
+
*
|
|
4
|
+
* @param x The number whose hyperbolic cosine is to be calculated.
|
|
5
|
+
* @returns The hyperbolic cosine of the provided number.
|
|
6
|
+
* @category Trigonometry
|
|
7
|
+
* @tags hyperbolic, cosine
|
|
8
|
+
*/
|
|
9
|
+
export declare function cosh(x: number): number;
|
|
10
|
+
//# sourceMappingURL=cosh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosh.d.ts","sourceRoot":"","sources":["../src/cosh.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtC"}
|
package/cjs/cosh.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cosh = cosh;
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the hyperbolic cosine of a number.
|
|
6
|
+
*
|
|
7
|
+
* @module cosh
|
|
8
|
+
*/
|
|
9
|
+
const exp_js_1 = require("./exp.js");
|
|
10
|
+
/**
|
|
11
|
+
* Calculates the hyperbolic cosine of a number.
|
|
12
|
+
*
|
|
13
|
+
* @param x The number whose hyperbolic cosine is to be calculated.
|
|
14
|
+
* @returns The hyperbolic cosine of the provided number.
|
|
15
|
+
* @category Trigonometry
|
|
16
|
+
* @tags hyperbolic, cosine
|
|
17
|
+
*/
|
|
18
|
+
function cosh(x) {
|
|
19
|
+
return ((0, exp_js_1.exp)(x) + (0, exp_js_1.exp)(-x)) / 2;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=cosh.js.map
|
package/cjs/cosh.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosh.js","sourceRoot":"","sources":["../src/cosh.ts"],"names":[],"mappings":";;AAeA,oBAEC;AAjBD;;;;GAIG;AACH,qCAA+B;AAE/B;;;;;;;GAOG;AACH,SAAgB,IAAI,CAAC,CAAS;IAC5B,OAAO,CAAC,IAAA,YAAG,EAAC,CAAC,CAAC,GAAG,IAAA,YAAG,EAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
package/cjs/exp.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the exponential function of a number, returning `e^x`.
|
|
3
|
+
*
|
|
4
|
+
* This is functionally equivalent to the `Math.exp` function.
|
|
5
|
+
*
|
|
6
|
+
* @param x The number to calculate the exponential function of (e^x)
|
|
7
|
+
* @returns The exponential function of the provided number.
|
|
8
|
+
* @category Exponential
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts no-eval
|
|
11
|
+
* import { exp } from "@nick/math";
|
|
12
|
+
* import assert from "node:assert";
|
|
13
|
+
*
|
|
14
|
+
* assert.equal(exp(0), 1);
|
|
15
|
+
* assert.equal(exp(1), 2.7182818284590455);
|
|
16
|
+
* assert.equal(exp(2), 7.389056098930649);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function exp(x: number): number;
|
|
20
|
+
//# sourceMappingURL=exp.d.ts.map
|
package/cjs/exp.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exp.d.ts","sourceRoot":"","sources":["../src/exp.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAgBrC"}
|
package/cjs/exp.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exp = exp;
|
|
4
|
+
/**
|
|
5
|
+
* @category Exponential
|
|
6
|
+
* @module exp
|
|
7
|
+
*/
|
|
8
|
+
const epsilon_js_1 = require("./constants/epsilon.js");
|
|
9
|
+
const negative_infinity_js_1 = require("./guards/negative_infinity.js");
|
|
10
|
+
const positive_infinity_js_1 = require("./guards/positive_infinity.js");
|
|
11
|
+
const nan_js_1 = require("./guards/nan.js");
|
|
12
|
+
const abs_js_1 = require("./abs.js");
|
|
13
|
+
/**
|
|
14
|
+
* Calculates the exponential function of a number, returning `e^x`.
|
|
15
|
+
*
|
|
16
|
+
* This is functionally equivalent to the `Math.exp` function.
|
|
17
|
+
*
|
|
18
|
+
* @param x The number to calculate the exponential function of (e^x)
|
|
19
|
+
* @returns The exponential function of the provided number.
|
|
20
|
+
* @category Exponential
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts no-eval
|
|
23
|
+
* import { exp } from "@nick/math";
|
|
24
|
+
* import assert from "node:assert";
|
|
25
|
+
*
|
|
26
|
+
* assert.equal(exp(0), 1);
|
|
27
|
+
* assert.equal(exp(1), 2.7182818284590455);
|
|
28
|
+
* assert.equal(exp(2), 7.389056098930649);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
function exp(x) {
|
|
32
|
+
if ((0, negative_infinity_js_1.isNegativeInfinity)(x))
|
|
33
|
+
return 0;
|
|
34
|
+
if ((0, positive_infinity_js_1.isPositiveInfinity)(x) || (0, nan_js_1.isNaN)(x))
|
|
35
|
+
return x;
|
|
36
|
+
if (x === 0)
|
|
37
|
+
return 1;
|
|
38
|
+
const a = (0, abs_js_1.abs)(x);
|
|
39
|
+
let result = 1, term = 1, iteration = 1;
|
|
40
|
+
// Using Taylor series expansion to approximate e^x
|
|
41
|
+
while (term > epsilon_js_1.EPSILON) {
|
|
42
|
+
term *= a / iteration;
|
|
43
|
+
result += term;
|
|
44
|
+
iteration += 1;
|
|
45
|
+
}
|
|
46
|
+
return x < 0 ? 1 / result : result;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=exp.js.map
|
package/cjs/exp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exp.js","sourceRoot":"","sources":["../src/exp.ts"],"names":[],"mappings":";;AA4BA,kBAgBC;AA5CD;;;GAGG;AACH,uDAAiD;AACjD,wEAAmE;AACnE,wEAAmE;AACnE,4CAAwC;AACxC,qCAA+B;AAE/B;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,GAAG,CAAC,CAAS;IAC3B,IAAI,IAAA,yCAAkB,EAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACpC,IAAI,IAAA,yCAAkB,EAAC,CAAC,CAAC,IAAI,IAAA,cAAK,EAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAEtB,MAAM,CAAC,GAAG,IAAA,YAAG,EAAC,CAAC,CAAC,CAAC;IACjB,IAAI,MAAM,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC;IAExC,mDAAmD;IACnD,OAAO,IAAI,GAAG,oBAAO,EAAE,CAAC;QACtB,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC;QACtB,MAAM,IAAI,IAAI,CAAC;QACf,SAAS,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;AACrC,CAAC"}
|
package/cjs/expm1.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates `exp(x) - 1` (the exponential of x minus 1).
|
|
3
|
+
*
|
|
4
|
+
* Accurate even for very small values of x.
|
|
5
|
+
*
|
|
6
|
+
* @param x The number whose exponential minus 1 is to be calculated.
|
|
7
|
+
* @returns The value of `exp(x) - 1`.
|
|
8
|
+
* @category Exponential
|
|
9
|
+
*/
|
|
10
|
+
export declare function expm1(x: number): number;
|
|
11
|
+
//# sourceMappingURL=expm1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expm1.d.ts","sourceRoot":"","sources":["../src/expm1.ts"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CASvC"}
|
package/cjs/expm1.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expm1 = expm1;
|
|
4
|
+
/**
|
|
5
|
+
* Calculates the exponential of `x` minus 1 (`exp(x) - 1`) with a high degree
|
|
6
|
+
* of accuracy, even for very small values of `x`.
|
|
7
|
+
*
|
|
8
|
+
* @module expm1
|
|
9
|
+
*/
|
|
10
|
+
const epsilon_js_1 = require("./constants/epsilon.js");
|
|
11
|
+
const abs_js_1 = require("./abs.js");
|
|
12
|
+
const exp_js_1 = require("./exp.js");
|
|
13
|
+
const negative_infinity_js_1 = require("./constants/negative_infinity.js");
|
|
14
|
+
const positive_infinity_js_1 = require("./constants/positive_infinity.js");
|
|
15
|
+
/**
|
|
16
|
+
* Calculates `exp(x) - 1` (the exponential of x minus 1).
|
|
17
|
+
*
|
|
18
|
+
* Accurate even for very small values of x.
|
|
19
|
+
*
|
|
20
|
+
* @param x The number whose exponential minus 1 is to be calculated.
|
|
21
|
+
* @returns The value of `exp(x) - 1`.
|
|
22
|
+
* @category Exponential
|
|
23
|
+
*/
|
|
24
|
+
function expm1(x) {
|
|
25
|
+
// fast paths for common cases
|
|
26
|
+
if ((x = +x) === 0)
|
|
27
|
+
return x; // respect -0
|
|
28
|
+
if (x === positive_infinity_js_1.POSITIVE_INFINITY)
|
|
29
|
+
return x;
|
|
30
|
+
if (x === negative_infinity_js_1.NEGATIVE_INFINITY)
|
|
31
|
+
return -1;
|
|
32
|
+
// for very small values of x, exp(x) - 1 is approximately equal to x
|
|
33
|
+
if ((0, abs_js_1.abs)(x) < epsilon_js_1.EPSILON)
|
|
34
|
+
return x;
|
|
35
|
+
// for all other values of x, exp(x) - 1 is accurate
|
|
36
|
+
return (0, exp_js_1.exp)(x) - 1;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=expm1.js.map
|
package/cjs/expm1.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expm1.js","sourceRoot":"","sources":["../src/expm1.ts"],"names":[],"mappings":";;AAqBA,sBASC;AA9BD;;;;;GAKG;AACH,uDAAiD;AACjD,qCAA+B;AAC/B,qCAA+B;AAC/B,2EAAqE;AACrE,2EAAqE;AAErE;;;;;;;;GAQG;AACH,SAAgB,KAAK,CAAC,CAAS;IAC7B,8BAA8B;IAC9B,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC,aAAa;IAC3C,IAAI,CAAC,KAAK,wCAAiB;QAAE,OAAO,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,wCAAiB;QAAE,OAAO,CAAC,CAAC,CAAC;IACvC,qEAAqE;IACrE,IAAI,IAAA,YAAG,EAAC,CAAC,CAAC,GAAG,oBAAO;QAAE,OAAO,CAAC,CAAC;IAC/B,oDAAoD;IACpD,OAAO,IAAA,YAAG,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rounds a number to the nearest 16-bit floating point value (half precision).
|
|
3
|
+
*
|
|
4
|
+
* Based on `Math.f16round` function from the TC39 Proposal for [Float16Array],
|
|
5
|
+
* which began shipping in ES2024, this function follows the same rounding and
|
|
6
|
+
* conversion rules as per the IEEE 754-2008 specification for half-precision
|
|
7
|
+
* floating-point numbers (also known as binary16).
|
|
8
|
+
*
|
|
9
|
+
* [Float16Array]: https://github.com/tc39/proposal-float16array
|
|
10
|
+
*
|
|
11
|
+
* @param x The number to round.
|
|
12
|
+
* @returns The 16-bit floating point rounded value of the number.
|
|
13
|
+
* @category Rounding
|
|
14
|
+
* @tags float, float16
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { f16round } from "@nick/math/f16round";
|
|
18
|
+
* import { PI } from "@nick/math/constants";
|
|
19
|
+
*
|
|
20
|
+
* console.assert(f16round(PI) === 3.140625); // OK
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function f16round(x: number): number;
|
|
24
|
+
//# sourceMappingURL=f16round.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"f16round.d.ts","sourceRoot":"","sources":["../src/f16round.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1C"}
|