@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
package/esm/max.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the largest of its arguments, or `NaN` if any argument is `NaN`.
|
|
3
|
+
* If no arguments are provided, the result is `-Infinity`.
|
|
4
|
+
*
|
|
5
|
+
* This function is designed as a fast alternative to the built-in `Math.max`
|
|
6
|
+
* function. It is optimized for performance, and isn't susceptible to any
|
|
7
|
+
* global state changes or monkey-patching that might affect the built-in
|
|
8
|
+
* `Math.max` function.
|
|
9
|
+
*
|
|
10
|
+
* @param numbers The numbers to compare.
|
|
11
|
+
* @returns The largest number in the list.
|
|
12
|
+
* @category Comparison
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { max } from "@nick/math";
|
|
16
|
+
*
|
|
17
|
+
* const largest = max(1, 2); // 2
|
|
18
|
+
* const alsoLargest = max(-1, 0); // 0
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function max(...numbers: number[]): number;
|
|
22
|
+
//# sourceMappingURL=max.d.ts.map
|
package/esm/max.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max.d.ts","sourceRoot":"","sources":["../src/max.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,GAAG,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAQhD"}
|
package/esm/max.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the largest of its arguments, or `NaN` if any argument is `NaN`.
|
|
3
|
+
* If no arguments are provided, the result is `-Infinity`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { max } from "@nick/math";
|
|
8
|
+
*
|
|
9
|
+
* const atLeastZero = (x: number) => max(x, 0);
|
|
10
|
+
*
|
|
11
|
+
* atLeastZero(+1); // 1
|
|
12
|
+
* atLeastZero(-1); // 0
|
|
13
|
+
* ```
|
|
14
|
+
* @module max
|
|
15
|
+
*/
|
|
16
|
+
import { NEGATIVE_INFINITY } from "./constants/negative_infinity.js";
|
|
17
|
+
/**
|
|
18
|
+
* Returns the largest of its arguments, or `NaN` if any argument is `NaN`.
|
|
19
|
+
* If no arguments are provided, the result is `-Infinity`.
|
|
20
|
+
*
|
|
21
|
+
* This function is designed as a fast alternative to the built-in `Math.max`
|
|
22
|
+
* function. It is optimized for performance, and isn't susceptible to any
|
|
23
|
+
* global state changes or monkey-patching that might affect the built-in
|
|
24
|
+
* `Math.max` function.
|
|
25
|
+
*
|
|
26
|
+
* @param numbers The numbers to compare.
|
|
27
|
+
* @returns The largest number in the list.
|
|
28
|
+
* @category Comparison
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { max } from "@nick/math";
|
|
32
|
+
*
|
|
33
|
+
* const largest = max(1, 2); // 2
|
|
34
|
+
* const alsoLargest = max(-1, 0); // 0
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export function max(...numbers) {
|
|
38
|
+
let result = NEGATIVE_INFINITY;
|
|
39
|
+
for (let i = 0; i < numbers.length; i++) {
|
|
40
|
+
const number = numbers[i];
|
|
41
|
+
if (number !== number)
|
|
42
|
+
return number;
|
|
43
|
+
if (number > result)
|
|
44
|
+
result = number;
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=max.js.map
|
package/esm/max.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max.js","sourceRoot":"","sources":["../src/max.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,OAAiB;IACtC,IAAI,MAAM,GAAG,iBAA2B,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,MAAM,KAAK,MAAM;YAAE,OAAO,MAAM,CAAC;QACrC,IAAI,MAAM,GAAG,MAAM;YAAE,MAAM,GAAG,MAAM,CAAC;IACvC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/esm/min.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the smallest of its arguments, or `NaN` if any argument is `NaN`.
|
|
3
|
+
* If no arguments are provided, the result is `Infinity`.
|
|
4
|
+
*
|
|
5
|
+
* @param numbers The numbers to compare.
|
|
6
|
+
* @returns The smallest number in the list.
|
|
7
|
+
* @category Comparison
|
|
8
|
+
*/
|
|
9
|
+
export declare function min(...numbers: number[]): number;
|
|
10
|
+
//# sourceMappingURL=min.d.ts.map
|
package/esm/min.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min.d.ts","sourceRoot":"","sources":["../src/min.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAchD"}
|
package/esm/min.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the smallest of its arguments, or `NaN` if any argument is `NaN`.
|
|
3
|
+
* If no arguments are provided, the result is `Infinity`.
|
|
4
|
+
*
|
|
5
|
+
* @module min
|
|
6
|
+
*/
|
|
7
|
+
import { POSITIVE_INFINITY } from "./constants/positive_infinity.js";
|
|
8
|
+
import { isNegativeZero } from "./guards/negative_zero.js";
|
|
9
|
+
/**
|
|
10
|
+
* Returns the smallest of its arguments, or `NaN` if any argument is `NaN`.
|
|
11
|
+
* If no arguments are provided, the result is `Infinity`.
|
|
12
|
+
*
|
|
13
|
+
* @param numbers The numbers to compare.
|
|
14
|
+
* @returns The smallest number in the list.
|
|
15
|
+
* @category Comparison
|
|
16
|
+
*/
|
|
17
|
+
export function min(...numbers) {
|
|
18
|
+
let result = POSITIVE_INFINITY;
|
|
19
|
+
for (let i = 0; i < numbers.length; i++) {
|
|
20
|
+
const number = numbers[i];
|
|
21
|
+
if (number !== number)
|
|
22
|
+
return number;
|
|
23
|
+
if (number < result) {
|
|
24
|
+
result = number;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (number === 0 && result === 0 && isNegativeZero(number)) {
|
|
28
|
+
result = number;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=min.js.map
|
package/esm/min.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min.js","sourceRoot":"","sources":["../src/min.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,OAAiB;IACtC,IAAI,MAAM,GAAG,iBAA2B,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,MAAM,KAAK,MAAM;YAAE,OAAO,MAAM,CAAC;QACrC,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC;YACpB,MAAM,GAAG,MAAM,CAAC;YAChB,SAAS;QACX,CAAC;QACD,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3D,MAAM,GAAG,MAAM,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/esm/package.json
ADDED
package/esm/pow.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the base number raised to the power of the exponent.
|
|
3
|
+
*
|
|
4
|
+
* @module pow
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Calculates the base number raised to the power of the exponent.
|
|
8
|
+
*
|
|
9
|
+
* **Note**: the `**` operator is equivalent to the `^` operator in standard
|
|
10
|
+
* mathematical notation, and is used to raise a number to a power. For those
|
|
11
|
+
* unfamiliar with its syntax: `x ** y` is the same as `x^y`.
|
|
12
|
+
*
|
|
13
|
+
* @param x The base number to raise to the power of `y`
|
|
14
|
+
* @param y The exponent to raise the base number by
|
|
15
|
+
* @returns The base number raised to the power of the exponent.
|
|
16
|
+
* @category Exponentiation
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { pow } from "@nick/math";
|
|
20
|
+
*
|
|
21
|
+
* const MAX_SAFE_INTEGER = pow(2, 53) - 1;
|
|
22
|
+
*
|
|
23
|
+
* const foursquared = pow(4, 2); // 16
|
|
24
|
+
*
|
|
25
|
+
* const infinity = pow(1, 309); // Infinity
|
|
26
|
+
*
|
|
27
|
+
* const almost_infinity = pow(1, 308); // 1.7976931348623157e+308
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function pow(x: number, y: number): number;
|
|
31
|
+
//# sourceMappingURL=pow.d.ts.map
|
package/esm/pow.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pow.d.ts","sourceRoot":"","sources":["../src/pow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
package/esm/pow.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the base number raised to the power of the exponent.
|
|
3
|
+
*
|
|
4
|
+
* @module pow
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Calculates the base number raised to the power of the exponent.
|
|
8
|
+
*
|
|
9
|
+
* **Note**: the `**` operator is equivalent to the `^` operator in standard
|
|
10
|
+
* mathematical notation, and is used to raise a number to a power. For those
|
|
11
|
+
* unfamiliar with its syntax: `x ** y` is the same as `x^y`.
|
|
12
|
+
*
|
|
13
|
+
* @param x The base number to raise to the power of `y`
|
|
14
|
+
* @param y The exponent to raise the base number by
|
|
15
|
+
* @returns The base number raised to the power of the exponent.
|
|
16
|
+
* @category Exponentiation
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { pow } from "@nick/math";
|
|
20
|
+
*
|
|
21
|
+
* const MAX_SAFE_INTEGER = pow(2, 53) - 1;
|
|
22
|
+
*
|
|
23
|
+
* const foursquared = pow(4, 2); // 16
|
|
24
|
+
*
|
|
25
|
+
* const infinity = pow(1, 309); // Infinity
|
|
26
|
+
*
|
|
27
|
+
* const almost_infinity = pow(1, 308); // 1.7976931348623157e+308
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function pow(x, y) {
|
|
31
|
+
return x ** y;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=pow.js.map
|
package/esm/pow.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pow.js","sourceRoot":"","sources":["../src/pow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,CAAS;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
package/esm/random.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mersenne Twister implementation in TypeScript.
|
|
3
|
+
*
|
|
4
|
+
* Based on the original C-code by Makoto Matsumoto and Takuji Nishimura.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This implementation is a simplified version of the original API, providing
|
|
8
|
+
* only a `random()` and `randomInt()` method for generating pseudo-random
|
|
9
|
+
* numbers, and a `init()` method for seeding the generator.
|
|
10
|
+
*
|
|
11
|
+
* Benchmarks show this API to be ever-so-slightly slower than the native
|
|
12
|
+
* `Math.random` function, while still performing well within an acceptable
|
|
13
|
+
* timing window. Since this is a pure-JS implementation, achieving speeds on
|
|
14
|
+
* the same level as a native API is simply not possible.
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { MT19937 } from "@nick/math/random";
|
|
18
|
+
*
|
|
19
|
+
* const mt = new MT19937();
|
|
20
|
+
* const n = mt.random(); // e.g. 0.9507143115624784
|
|
21
|
+
* ```
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { MT19937 } from "@nick/math/random";
|
|
25
|
+
*
|
|
26
|
+
* const mt = new MT19937(42);
|
|
27
|
+
* console.log(mt.random()); // 0.37454011430963874
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html for the
|
|
31
|
+
* original C code this is based on and more information on Mersenne Twister.
|
|
32
|
+
*/
|
|
33
|
+
export declare class MT19937 {
|
|
34
|
+
#private;
|
|
35
|
+
/**
|
|
36
|
+
* Initialize the singleton instance with a seed.
|
|
37
|
+
*
|
|
38
|
+
* @param seed - The seed value.
|
|
39
|
+
* @returns The singleton instance.
|
|
40
|
+
*/
|
|
41
|
+
static init(...seed: number[]): MT19937;
|
|
42
|
+
/**
|
|
43
|
+
* Generates a random number on [0, 1)-real-interval.
|
|
44
|
+
* @returns A floating-point number between 0 and 1.
|
|
45
|
+
*/
|
|
46
|
+
static random(): number;
|
|
47
|
+
/**
|
|
48
|
+
* Generates a random number on [0, 0xffffffff]-interval.
|
|
49
|
+
* @returns A 32-bit unsigned integer.
|
|
50
|
+
*/
|
|
51
|
+
static randomInt(): number;
|
|
52
|
+
/**
|
|
53
|
+
* Initializes a new instance of the MersenneTwister class.
|
|
54
|
+
* @param seed - The seed value.
|
|
55
|
+
*/
|
|
56
|
+
constructor(seed?: number);
|
|
57
|
+
/**
|
|
58
|
+
* Initializes mt[N] with a seed.
|
|
59
|
+
* @param seed - The seed value.
|
|
60
|
+
*/
|
|
61
|
+
init(seed?: number): this;
|
|
62
|
+
/**
|
|
63
|
+
* Initialize by an array with array-length.
|
|
64
|
+
* @param seeds - The array for initializing keys.
|
|
65
|
+
*/
|
|
66
|
+
initFromArray(...seeds: number[]): this;
|
|
67
|
+
/**
|
|
68
|
+
* Generates a random number on [0, 0xffffffff]-interval.
|
|
69
|
+
* @returns A 32-bit unsigned integer.
|
|
70
|
+
*/
|
|
71
|
+
randomInt(): number;
|
|
72
|
+
/**
|
|
73
|
+
* Generates a random number on [0, 1)-real-interval.
|
|
74
|
+
* @returns A floating-point number between 0 and 1.
|
|
75
|
+
*/
|
|
76
|
+
random(): number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Generates a pseudo-random number in the range `[0, 1)`. This function is not
|
|
80
|
+
* cryptographically secure, and should not be used for any security-sensitive
|
|
81
|
+
* applications. It was designed to be a drop-in replacement for the native
|
|
82
|
+
* `Math.random()` function, with support for seeding the generator.
|
|
83
|
+
*
|
|
84
|
+
* @returns A pseudo-random number in the range `[0, 1)`.
|
|
85
|
+
* @category Random
|
|
86
|
+
* @see {@linkcode random.init} for seeding the generator.
|
|
87
|
+
* @see {@linkcode MT19937} for the Mersenne-Twister implementation this uses.
|
|
88
|
+
*/
|
|
89
|
+
export declare function random(): number;
|
|
90
|
+
export declare namespace random {
|
|
91
|
+
var init: typeof MT19937.init;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=random.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,OAAO;;IAGlB;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO;IAQvC;;;OAGG;IACH,MAAM,CAAC,MAAM,IAAI,MAAM;IAIvB;;;OAGG;IACH,MAAM,CAAC,SAAS,IAAI,MAAM;IAU1B;;;OAGG;gBACS,IAAI,CAAC,EAAE,MAAM;IAIzB;;;OAGG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAezB;;;OAGG;IACH,aAAa,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAmCvC;;;OAGG;IACH,SAAS,IAAI,MAAM;IAoCnB;;;OAGG;IACH,MAAM,IAAI,MAAM;CAGjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,IAAI,MAAM,CAE/B;yBAFe,MAAM"}
|
package/esm/random.js
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
+
};
|
|
12
|
+
var _a, _MT19937_instance, _MT19937_mt, _MT19937_mti;
|
|
13
|
+
/**
|
|
14
|
+
* Generates a pseudo-random number in the range `[0, 1)`.
|
|
15
|
+
*
|
|
16
|
+
* **Important**: This function is not cryptographically secure. Do not use it
|
|
17
|
+
* for security-sensitive applications.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { random } from "@nick/math/random";
|
|
22
|
+
*
|
|
23
|
+
* console.log(random());
|
|
24
|
+
* // => 0.5390711768976619
|
|
25
|
+
* ```
|
|
26
|
+
* @module random
|
|
27
|
+
*/
|
|
28
|
+
import { ArrayFrom, DateNow } from "./internal/primordials.js";
|
|
29
|
+
/** Period parameters */
|
|
30
|
+
const N = 624;
|
|
31
|
+
/** The number of 32 bit words */
|
|
32
|
+
const M = 397;
|
|
33
|
+
/** Constant Vector A */
|
|
34
|
+
const MATRIX_A = 0x9908b0df;
|
|
35
|
+
/** Most significant W-R bits */
|
|
36
|
+
const UPPER_MASK = 0x80000000;
|
|
37
|
+
/** Least significant R bits */
|
|
38
|
+
const LOWER_MASK = 0x7fffffff;
|
|
39
|
+
/** UPPER_MASK + LOWER_MASK + 1 */
|
|
40
|
+
const TOTAL_MASK = 0x100000000;
|
|
41
|
+
/**
|
|
42
|
+
* Mersenne Twister implementation in TypeScript.
|
|
43
|
+
*
|
|
44
|
+
* Based on the original C-code by Makoto Matsumoto and Takuji Nishimura.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* This implementation is a simplified version of the original API, providing
|
|
48
|
+
* only a `random()` and `randomInt()` method for generating pseudo-random
|
|
49
|
+
* numbers, and a `init()` method for seeding the generator.
|
|
50
|
+
*
|
|
51
|
+
* Benchmarks show this API to be ever-so-slightly slower than the native
|
|
52
|
+
* `Math.random` function, while still performing well within an acceptable
|
|
53
|
+
* timing window. Since this is a pure-JS implementation, achieving speeds on
|
|
54
|
+
* the same level as a native API is simply not possible.
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* import { MT19937 } from "@nick/math/random";
|
|
58
|
+
*
|
|
59
|
+
* const mt = new MT19937();
|
|
60
|
+
* const n = mt.random(); // e.g. 0.9507143115624784
|
|
61
|
+
* ```
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { MT19937 } from "@nick/math/random";
|
|
65
|
+
*
|
|
66
|
+
* const mt = new MT19937(42);
|
|
67
|
+
* console.log(mt.random()); // 0.37454011430963874
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html for the
|
|
71
|
+
* original C code this is based on and more information on Mersenne Twister.
|
|
72
|
+
*/
|
|
73
|
+
export class MT19937 {
|
|
74
|
+
/**
|
|
75
|
+
* Initialize the singleton instance with a seed.
|
|
76
|
+
*
|
|
77
|
+
* @param seed - The seed value.
|
|
78
|
+
* @returns The singleton instance.
|
|
79
|
+
*/
|
|
80
|
+
static init(...seed) {
|
|
81
|
+
if (seed.length > 1) {
|
|
82
|
+
return __classPrivateFieldGet(_a, _a, "f", _MT19937_instance).initFromArray(...seed);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
return __classPrivateFieldGet(_a, _a, "f", _MT19937_instance).init(seed[0]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Generates a random number on [0, 1)-real-interval.
|
|
90
|
+
* @returns A floating-point number between 0 and 1.
|
|
91
|
+
*/
|
|
92
|
+
static random() {
|
|
93
|
+
return __classPrivateFieldGet(_a, _a, "f", _MT19937_instance).random();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Generates a random number on [0, 0xffffffff]-interval.
|
|
97
|
+
* @returns A 32-bit unsigned integer.
|
|
98
|
+
*/
|
|
99
|
+
static randomInt() {
|
|
100
|
+
return __classPrivateFieldGet(_a, _a, "f", _MT19937_instance).randomInt();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Initializes a new instance of the MersenneTwister class.
|
|
104
|
+
* @param seed - The seed value.
|
|
105
|
+
*/
|
|
106
|
+
constructor(seed) {
|
|
107
|
+
/** the array for the state vector */
|
|
108
|
+
_MT19937_mt.set(this, ArrayFrom({ length: N }, () => 0));
|
|
109
|
+
/** mti == N + 1 means mt[N] is not initialized */
|
|
110
|
+
_MT19937_mti.set(this, N + 1);
|
|
111
|
+
this.init(seed);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Initializes mt[N] with a seed.
|
|
115
|
+
* @param seed - The seed value.
|
|
116
|
+
*/
|
|
117
|
+
init(seed) {
|
|
118
|
+
seed ?? (seed = DateNow());
|
|
119
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[0] = seed >>> 0;
|
|
120
|
+
const mt = __classPrivateFieldGet(this, _MT19937_mt, "f");
|
|
121
|
+
const x = 1812433253, y = 0xffff0000, z = 0x0000ffff;
|
|
122
|
+
for (let i = 1; i < N; i++) {
|
|
123
|
+
const s = mt[i - 1] ^ (mt[i - 1] >>> 30);
|
|
124
|
+
const l = (((s & y) >>> 16) * x) << 16;
|
|
125
|
+
const r = (s & z) * x;
|
|
126
|
+
mt[__classPrivateFieldSet(this, _MT19937_mti, i, "f")] = (l + r + i) >>> 0;
|
|
127
|
+
}
|
|
128
|
+
__classPrivateFieldSet(this, _MT19937_mti, N, "f");
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Initialize by an array with array-length.
|
|
133
|
+
* @param seeds - The array for initializing keys.
|
|
134
|
+
*/
|
|
135
|
+
initFromArray(...seeds) {
|
|
136
|
+
let i = 1, j = 0;
|
|
137
|
+
const len = seeds.length;
|
|
138
|
+
this.init(19650218);
|
|
139
|
+
let k = N > len ? N : len;
|
|
140
|
+
const w = 1566083941;
|
|
141
|
+
const x = 1664525, y = 0xffff0000, z = 0x0000ffff;
|
|
142
|
+
for (; k > 0; k--) {
|
|
143
|
+
const s = __classPrivateFieldGet(this, _MT19937_mt, "f")[i - 1] ^ (__classPrivateFieldGet(this, _MT19937_mt, "f")[i - 1] >>> 30);
|
|
144
|
+
const u = (s & z) * x;
|
|
145
|
+
let t = ((s & y) >>> 16) * x << 16;
|
|
146
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[i] = (t = __classPrivateFieldGet(this, _MT19937_mt, "f")[i] ^ t + u, t += seeds[j] + j, t >>> 0);
|
|
147
|
+
i++, j++;
|
|
148
|
+
if (i >= N) {
|
|
149
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[0] = __classPrivateFieldGet(this, _MT19937_mt, "f")[N - 1];
|
|
150
|
+
i = 1;
|
|
151
|
+
}
|
|
152
|
+
if (j >= len)
|
|
153
|
+
j = 0;
|
|
154
|
+
}
|
|
155
|
+
for (k = N - 1; k > 0; k--) {
|
|
156
|
+
const s = __classPrivateFieldGet(this, _MT19937_mt, "f")[i - 1] ^ (__classPrivateFieldGet(this, _MT19937_mt, "f")[i - 1] >>> 30);
|
|
157
|
+
let t = __classPrivateFieldGet(this, _MT19937_mt, "f")[i];
|
|
158
|
+
t ^= (((s & y) >>> 16) * w << 16) + (s & z) * w;
|
|
159
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[i] = (t - i) >>> 0;
|
|
160
|
+
i++;
|
|
161
|
+
if (i >= N) {
|
|
162
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[0] = __classPrivateFieldGet(this, _MT19937_mt, "f")[N - 1];
|
|
163
|
+
i = 1;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/* MSB is 1; assuring non-zero initial array */
|
|
167
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[0] = 0x80000000;
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Generates a random number on [0, 0xffffffff]-interval.
|
|
172
|
+
* @returns A 32-bit unsigned integer.
|
|
173
|
+
*/
|
|
174
|
+
randomInt() {
|
|
175
|
+
var _b, _c;
|
|
176
|
+
let y;
|
|
177
|
+
const mag01 = [0x0, MATRIX_A];
|
|
178
|
+
if (__classPrivateFieldGet(this, _MT19937_mti, "f") >= N) {
|
|
179
|
+
let kk;
|
|
180
|
+
/* a default initial seed is used */
|
|
181
|
+
if (__classPrivateFieldGet(this, _MT19937_mti, "f") === N + 1)
|
|
182
|
+
this.init(5489);
|
|
183
|
+
for (kk = 0; kk < N - M; kk++) {
|
|
184
|
+
y = (__classPrivateFieldGet(this, _MT19937_mt, "f")[kk] & UPPER_MASK) | (__classPrivateFieldGet(this, _MT19937_mt, "f")[kk + 1] & LOWER_MASK);
|
|
185
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[kk] = __classPrivateFieldGet(this, _MT19937_mt, "f")[kk + M] ^ (y >>> 1) ^ mag01[y & 0x1];
|
|
186
|
+
}
|
|
187
|
+
for (; kk < N - 1; kk++) {
|
|
188
|
+
y = (__classPrivateFieldGet(this, _MT19937_mt, "f")[kk] & UPPER_MASK) | (__classPrivateFieldGet(this, _MT19937_mt, "f")[kk + 1] & LOWER_MASK);
|
|
189
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[kk] = __classPrivateFieldGet(this, _MT19937_mt, "f")[kk + (M - N)] ^ (y >>> 1) ^ mag01[y & 0x1];
|
|
190
|
+
}
|
|
191
|
+
y = (__classPrivateFieldGet(this, _MT19937_mt, "f")[N - 1] & UPPER_MASK) | (__classPrivateFieldGet(this, _MT19937_mt, "f")[0] & LOWER_MASK);
|
|
192
|
+
__classPrivateFieldGet(this, _MT19937_mt, "f")[N - 1] = __classPrivateFieldGet(this, _MT19937_mt, "f")[M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];
|
|
193
|
+
__classPrivateFieldSet(this, _MT19937_mti, 0, "f");
|
|
194
|
+
}
|
|
195
|
+
y = __classPrivateFieldGet(this, _MT19937_mt, "f")[__classPrivateFieldSet(this, _MT19937_mti, (_c = __classPrivateFieldGet(this, _MT19937_mti, "f"), _b = _c++, _c), "f"), _b];
|
|
196
|
+
// Tempering
|
|
197
|
+
y ^= y >>> 11;
|
|
198
|
+
y ^= (y << 7) & 0x9d2c5680;
|
|
199
|
+
y ^= (y << 15) & 0xefc60000;
|
|
200
|
+
y ^= y >>> 18;
|
|
201
|
+
return y >>> 0;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Generates a random number on [0, 1)-real-interval.
|
|
205
|
+
* @returns A floating-point number between 0 and 1.
|
|
206
|
+
*/
|
|
207
|
+
random() {
|
|
208
|
+
return this.randomInt() / TOTAL_MASK;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
_a = MT19937, _MT19937_mt = new WeakMap(), _MT19937_mti = new WeakMap();
|
|
212
|
+
_MT19937_instance = { value: new _a() };
|
|
213
|
+
/**
|
|
214
|
+
* Generates a pseudo-random number in the range `[0, 1)`. This function is not
|
|
215
|
+
* cryptographically secure, and should not be used for any security-sensitive
|
|
216
|
+
* applications. It was designed to be a drop-in replacement for the native
|
|
217
|
+
* `Math.random()` function, with support for seeding the generator.
|
|
218
|
+
*
|
|
219
|
+
* @returns A pseudo-random number in the range `[0, 1)`.
|
|
220
|
+
* @category Random
|
|
221
|
+
* @see {@linkcode random.init} for seeding the generator.
|
|
222
|
+
* @see {@linkcode MT19937} for the Mersenne-Twister implementation this uses.
|
|
223
|
+
*/
|
|
224
|
+
export function random() {
|
|
225
|
+
return MT19937.random();
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Initializes the random number generator with a seed or sequence of seeds.
|
|
229
|
+
*
|
|
230
|
+
* This is useful for testing, allowing you to generate a deterministic
|
|
231
|
+
* sequence of pseudo-random numbers based on the provided seed value.
|
|
232
|
+
*
|
|
233
|
+
* @param seed - The seed value or sequence of seed values.
|
|
234
|
+
* @returns The singleton instance of the random number generator.
|
|
235
|
+
*/
|
|
236
|
+
random.init = MT19937.init;
|
|
237
|
+
//# sourceMappingURL=random.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.js","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAE/D,wBAAwB;AACxB,MAAM,CAAC,GAAG,GAAG,CAAC;AACd,iCAAiC;AACjC,MA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I,CAAC,CAAC,GAAG,UAAU,CAAC;QAC3B,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC;QAC5B,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAEd,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,EAAE,GAAG,UAAU,CAAC;IACvC,CAAC;;;AAtJe,6BAAY,IAAI,EAAO,EAAE,EAAhB,CAAiB;AAyJ5C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC"}
|
package/esm/round.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rounds a number to the nearest whole number.
|
|
3
|
+
*
|
|
4
|
+
* @param x The number to round to the nearest whole number
|
|
5
|
+
* @returns The nearest whole number to the provided number.
|
|
6
|
+
* @category Rounding
|
|
7
|
+
*/
|
|
8
|
+
export declare function round(x: number): number;
|
|
9
|
+
//# sourceMappingURL=round.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../src/round.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAKvC"}
|
package/esm/round.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rounds a number to the nearest whole number.
|
|
3
|
+
*
|
|
4
|
+
* @module round
|
|
5
|
+
*/
|
|
6
|
+
import { floor } from "./floor.js";
|
|
7
|
+
/**
|
|
8
|
+
* Rounds a number to the nearest whole number.
|
|
9
|
+
*
|
|
10
|
+
* @param x The number to round to the nearest whole number
|
|
11
|
+
* @returns The nearest whole number to the provided number.
|
|
12
|
+
* @category Rounding
|
|
13
|
+
*/
|
|
14
|
+
export function round(x) {
|
|
15
|
+
x = +x;
|
|
16
|
+
if (x !== x || x === 0)
|
|
17
|
+
return x;
|
|
18
|
+
const rounded = floor(x + 0.5);
|
|
19
|
+
return rounded === 0 && x < 0 ? -0 : rounded;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=round.js.map
|
package/esm/round.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round.js","sourceRoot":"","sources":["../src/round.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,CAAS;IAC7B,CAAC,GAAG,CAAC,CAAC,CAAC;IACP,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC/B,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC/C,CAAC"}
|
package/esm/sign.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the sign of a number, indicating whether the number is positive,
|
|
3
|
+
* negative, or zero.
|
|
4
|
+
*
|
|
5
|
+
* @module sign
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns the sign of a number, indicating whether the number is positive,
|
|
9
|
+
* negative, or zero. This preserves the sign of `-0`, and returns `NaN` as-is.
|
|
10
|
+
*
|
|
11
|
+
* @param x The number to return the sign of
|
|
12
|
+
* @returns `1` if `x` is positive, `-1` if it is negative, and `0` if it is
|
|
13
|
+
* zero. This preserves the sign of `-0`, and returns `NaN` as-is.
|
|
14
|
+
* @category Arithmetic
|
|
15
|
+
*/
|
|
16
|
+
export declare function sign(x: number): number;
|
|
17
|
+
//# sourceMappingURL=sign.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../src/sign.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtC"}
|
package/esm/sign.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the sign of a number, indicating whether the number is positive,
|
|
3
|
+
* negative, or zero.
|
|
4
|
+
*
|
|
5
|
+
* @module sign
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns the sign of a number, indicating whether the number is positive,
|
|
9
|
+
* negative, or zero. This preserves the sign of `-0`, and returns `NaN` as-is.
|
|
10
|
+
*
|
|
11
|
+
* @param x The number to return the sign of
|
|
12
|
+
* @returns `1` if `x` is positive, `-1` if it is negative, and `0` if it is
|
|
13
|
+
* zero. This preserves the sign of `-0`, and returns `NaN` as-is.
|
|
14
|
+
* @category Arithmetic
|
|
15
|
+
*/
|
|
16
|
+
export function sign(x) {
|
|
17
|
+
return x < 0 ? -1 : x > 0 ? 1 : x;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=sign.js.map
|
package/esm/sign.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign.js","sourceRoot":"","sources":["../src/sign.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAAC,CAAS;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
|
package/esm/sin.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the sine of a number, returning a value in the range `[-1, 1]`.
|
|
3
|
+
*
|
|
4
|
+
* @module sin
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Calculates the sine of a number, returning a value in the range `[-1, 1]`.
|
|
8
|
+
*
|
|
9
|
+
* @param x The angle in radians whose sine is to be calculated.
|
|
10
|
+
* @returns The sine of the provided angle.
|
|
11
|
+
* @category Trigonometry
|
|
12
|
+
*/
|
|
13
|
+
export declare function sin(x: number): number;
|
|
14
|
+
//# sourceMappingURL=sin.d.ts.map
|
package/esm/sin.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sin.d.ts","sourceRoot":"","sources":["../src/sin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAUrC"}
|