diff --git a/README.md b/README.md index 76b7eb8e3..dde5dd590 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.287.so` and executable `meevax`. +| `all` | Build shared-library `libmeevax.0.5.288.so` and executable `meevax`. | `install` | Copy files into `/usr/local` directly. -| `package` | Generate debian package `meevax_0.5.287_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.287_amd64.deb`. +| `package` | Generate debian package `meevax_0.5.288_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.288_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 bd4dd1e37..f8dc1ad47 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.287 +0.5.288 diff --git a/basis/srfi-144.ss b/basis/srfi-144.ss index 93208d1e4..11a2eb6ad 100644 --- a/basis/srfi-144.ss +++ b/basis/srfi-144.ss @@ -1,5 +1,5 @@ (define-library (srfi 144) - (import (only (meevax inexact) + (import (only (meevax binary64) FP_FAST_FMA binary64-denormalized? binary64-epsilon @@ -14,6 +14,8 @@ binary64-normalized? binary64-sign-bit binary64? + ) + (only (meevax inexact) copy-sign e euler diff --git a/src/kernel/boot.cpp b/src/kernel/boot.cpp index ed6aaf6e0..c34ed991a 100644 --- a/src/kernel/boot.cpp +++ b/src/kernel/boot.cpp @@ -430,16 +430,6 @@ namespace meevax::inline kernel define("(meevax inexact)", [](library & library) { - library.define("binary32?", [](let const& xs) - { - return std::numeric_limits::is_iec559 and car(xs).is(); - }); - - library.define("binary64?", [](let const& xs) - { - return std::numeric_limits::is_iec559 and car(xs).is(); - }); - library.define("finite?", [](let const& xs) { return is_finite(car(xs)); @@ -570,6 +560,42 @@ namespace meevax::inline kernel return load_exponent(car(xs), cadr(xs)); }); + library.define("e", std::numbers::e); + + library.define("pi", std::numbers::pi); + + library.define("euler", std::numbers::egamma); + + library.define("phi", std::numbers::phi); + }); + + define("(meevax binary32)", [](library & library) + { + library.define("binary32?", [](let const& xs) + { + return std::numeric_limits::is_iec559 and car(xs).is(); + }); + }); + + define("(meevax binary64)", [](library & library) + { + library.define("binary64?", [](let const& xs) + { + return std::numeric_limits::is_iec559 and car(xs).is(); + }); + + library.define("binary64-min", std::numeric_limits::min()); + + library.define("binary64-max", std::numeric_limits::max()); + + library.define("binary64-epsilon", std::numeric_limits::epsilon()); + + #ifdef FP_FAST_FMA + library.define("FP_FAST_FMA", true); + #else + library.define("FP_FAST_FMA", false); + #endif + library.define("binary64-integral-part", [](let const& xs) { auto integral_part = 0.0; @@ -620,26 +646,6 @@ namespace meevax::inline kernel { return std::fpclassify(car(xs).as()) == FP_SUBNORMAL; }); - - library.define("e", std::numbers::e); - - library.define("pi", std::numbers::pi); - - library.define("euler", std::numbers::egamma); - - library.define("phi", std::numbers::phi); - - library.define("binary64-max", std::numeric_limits::max()); - - library.define("binary64-min", std::numeric_limits::min()); - - library.define("binary64-epsilon", std::numeric_limits::epsilon()); - - #ifdef FP_FAST_FMA - library.define("FP_FAST_FMA", true); - #else - library.define("FP_FAST_FMA", false); - #endif }); define("(meevax list)", [](library & library) diff --git a/test/number.ss b/test/number.ss index 1631447c6..6b6ac8a5b 100644 --- a/test/number.ss +++ b/test/number.ss @@ -1,7 +1,8 @@ (import (scheme base) (scheme inexact) (scheme process-context) - (only (meevax inexact) binary32? binary64?) + (only (meevax binary32) binary32?) + (only (meevax binary64) binary64?) (srfi 78) (srfi 144)) diff --git a/test/srfi-144.ss b/test/srfi-144.ss index ef08d60ef..72636d812 100644 --- a/test/srfi-144.ss +++ b/test/srfi-144.ss @@ -1,5 +1,4 @@ -(import (only (meevax inexact) binary64?) - (scheme base) +(import (scheme base) (scheme process-context) (srfi 78) (srfi 144)) @@ -82,15 +81,15 @@ (check fl-gamma-2/3 => 1.3541179394264004169452880281545137855193) -(check (binary64? fl-greatest) => #t) +(check (flonum? fl-greatest) => #t) -(check (binary64? fl-least) => #t) +(check (flonum? fl-least) => #t) (check (< 0.0 0.0) => #f) (check (< 0.0 fl-least) => #t) -(check (binary64? fl-epsilon) => #t) +(check (flonum? fl-epsilon) => #t) (check (boolean? fl-fast-fl+*) => #t)