diff --git a/README.md b/README.md index 2684bbbe5..b707ee102 100644 --- a/README.md +++ b/README.md @@ -97,9 +97,9 @@ Then, select one of the following targets and `make` it according to your purpos | Target | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.284.so` and executable `meevax`. +| `all` | Build shared-library `libmeevax.0.5.285.so` and executable `meevax`. | `install` | Copy files into `/usr/local` directly. -| `package` | Generate debian package `meevax_0.5.284_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.284_amd64.deb`. +| `package` | Generate debian package `meevax_0.5.285_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.285_amd64.deb`. | `test` | Test executable `meevax`. This target requires Valgrind to be installed. | `uninstall` | Remove files copied to `/usr/local` directly by target `install`. diff --git a/VERSION b/VERSION index 97bd45ba8..10c6f5664 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.284 +0.5.285 diff --git a/basis/srfi-144.ss b/basis/srfi-144.ss index 3605b85f7..b8b9cfb2f 100644 --- a/basis/srfi-144.ss +++ b/basis/srfi-144.ss @@ -6,10 +6,12 @@ binary64-epsilon binary64-exponent binary64-fractional-part - binary64-integer-exponent + binary64-integer-log-binary binary64-integral-part + binary64-log-binary binary64-max binary64-min + binary64-normalized-fraction copy-sign e euler @@ -48,7 +50,8 @@ flonum fladjacent flcopysign make-flonum flinteger-fraction flexponent flinteger-exponent - ; flnormalized-fraction-exponent flsign-bit + flnormalized-fraction-exponent + ;flsign-bit ; ; flonum? fl=? fl? fl<=? fl>=? ; flunordered? flinteger? flzero? flpositive? flnegative? @@ -173,8 +176,12 @@ (values (binary64-integral-part x) (binary64-fractional-part x))) - (define flexponent binary64-exponent) + (define flexponent binary64-log-binary) - (define flinteger-exponent binary64-integer-exponent) + (define flinteger-exponent binary64-integer-log-binary) + + (define (flnormalized-fraction-exponent x) + (values (binary64-normalized-fraction x) + (binary64-exponent x))) ) ) diff --git a/src/kernel/boot.cpp b/src/kernel/boot.cpp index b81e4f1f9..9f2ae2d30 100644 --- a/src/kernel/boot.cpp +++ b/src/kernel/boot.cpp @@ -583,16 +583,29 @@ namespace meevax::inline kernel return make(std::modf(car(xs).as(), &integral_part)); }); - library.define("binary64-exponent", [](let const& xs) + library.define("binary64-log-binary", [](let const& xs) { return make(std::logb(car(xs).as())); }); - library.define("binary64-integer-exponent", [](let const& xs) + library.define("binary64-integer-log-binary", [](let const& xs) { return make(std::ilogb(car(xs).as())); }); + library.define("binary64-normalized-fraction", [](let const& xs) + { + auto exponent = 0; + return make(std::frexp(car(xs).as(), &exponent)); + }); + + library.define("binary64-exponent", [](let const& xs) + { + auto exponent = 0; + std::frexp(car(xs).as(), &exponent); + return make(exponent); + }); + library.define("e", std::numbers::e); library.define("pi", std::numbers::pi);