Skip to content

Commit

Permalink
Add new procedure copy-sign
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Dec 7, 2024
1 parent 7f7b53a commit e99ca9d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.277.so` and executable `meevax`.
| `all` | Build shared-library `libmeevax.0.5.278.so` and executable `meevax`.
| `install` | Copy files into `/usr/local` directly.
| `package` | Generate debian package `meevax_0.5.277_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.277_amd64.deb`.
| `package` | Generate debian package `meevax_0.5.278_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.278_amd64.deb`.
| `test` | Test executable `meevax`. This target requires Valgrind to be installed.
| `uninstall` | Remove files copied to `/usr/local` directly by target `install`.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.277
0.5.278
3 changes: 3 additions & 0 deletions basis/srfi-144.ss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
binary64-epsilon
binary64-max
binary64-min
copy-sign
e
euler
gamma
Expand Down Expand Up @@ -157,5 +158,7 @@
(define flonum inexact)

(define fladjacent next-after)

(define flcopysign copy-sign)
)
)
2 changes: 2 additions & 0 deletions include/meevax/kernel/number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ inline namespace number

auto next_after(object const&, object const&) -> object;

auto copy_sign(object const&, object const&) -> object;

auto number_to_string(object const&, int) -> object;
} // namespace number
} // namespace kernel
Expand Down
5 changes: 5 additions & 0 deletions src/kernel/boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,11 @@ namespace meevax::inline kernel
return next_after(car(xs), cadr(xs));
});

library.define<procedure>("copy-sign", [](let const& xs)
{
return copy_sign(car(xs), cadr(xs));
});

library.define<double>("e", std::numbers::e);

library.define<double>("pi", std::numbers::pi);
Expand Down
1 change: 1 addition & 0 deletions src/kernel/number.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ inline namespace number
}

DEFINE_REAL_BINARY(atan, std::atan2)
DEFINE_REAL_BINARY(copy_sign, std::copysign)
DEFINE_REAL_BINARY(next_after, std::nextafter)

auto number_to_string(object const& x, int radix) -> object
Expand Down

0 comments on commit e99ca9d

Please sign in to comment.