hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit b368696d06e76dd03012e0e226cbe4f0cb4850a5
parent c43a9f3d5780d0bcd2887696caaf821955b0a44c
Author: Sebastian <sebastian@sebsite.pw>
Date:   Fri, 27 May 2022 22:28:33 -0400

math: export more constants

The primary reason for this is that LOG10_E is used by math::complex, so
it can be exported here rather than duplicating it. It's also generally
useful to have access to these constants from outside of the module.

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mmath/math.ha | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/math/math.ha b/math/math.ha @@ -119,23 +119,25 @@ export def PI: f64 = 3.141592653589793238462643383279502884197169399375105820974 // phi - https://oeis.org/A001622 export def PHI: f64 = 1.61803398874989484820458683436563811772030917980576286213544862; // sqrt(2) - https://oeis.org/A002193 -def SQRT_2: f64 = 1.41421356237309504880168872420969807856967187537694807317667974; +export def SQRT_2: f64 = 1.41421356237309504880168872420969807856967187537694807317667974; // sqrt(e) - https://oeis.org/A019774 -def SQRT_E: f64 = 1.64872127070012814684865078781416357165377610071014801157507931; +export def SQRT_E: f64 = 1.64872127070012814684865078781416357165377610071014801157507931; // sqrt(pi) - https://oeis.org/A002161 -def SQRT_PI: f64 = 1.77245385090551602729816748334114518279754945612238712821380779; +export def SQRT_PI: f64 = 1.77245385090551602729816748334114518279754945612238712821380779; // sqrt(phi) - https://oeis.org/A139339 -def SQRT_PHI: f64 = 1.27201964951406896425242246173749149171560804184009624861664038; +export def SQRT_PHI: f64 = 1.27201964951406896425242246173749149171560804184009624861664038; // ln(2) - https://oeis.org/A002162 -def LN_2: f64 = 0.693147180559945309417232121458176568075500134360255254120680009; -def LN2_HI: f64 = 6.93147180369123816490e-01; -def LN2_LO: f64 = 1.90821492927058770002e-10; +export def LN_2: f64 = 0.693147180559945309417232121458176568075500134360255254120680009; +// ln(2) - https://oeis.org/A002162 +export def LN2_HI: f64 = 6.93147180369123816490e-01; +// ln(2) - https://oeis.org/A002162 +export def LN2_LO: f64 = 1.90821492927058770002e-10; // log_{2}(e) -def LOG2_E: f64 = 1f64 / LN_2; +export def LOG2_E: f64 = 1f64 / LN_2; // ln(10) - https://oeis.org/A002392 -def LN_10: f64 = 2.30258509299404568401799145468436420760110148862877297603332790; +export def LN_10: f64 = 2.30258509299404568401799145468436420760110148862877297603332790; // log_{10}(e) -def LOG10_E: f64 = 1f64 / LN_10; +export def LOG10_E: f64 = 1f64 / LN_10; // __ieee754_log(x) // Return the logarithm of x