diff options
| author | Yusuke Endoh <mame@ruby-lang.org> | 2025-08-02 20:15:06 +0900 |
|---|---|---|
| committer | Yusuke Endoh <mame@ruby-lang.org> | 2025-08-21 20:05:52 +0900 |
| commit | f2b1017b3df5f93aaf1d4ccd758d341298aa8dcc (patch) | |
| tree | 456c92abfccb2a5b75fee87709e46881a2f403e4 /spec/ruby/shared/kernel | |
| parent | feb83316730548d31b4be8076b8316e8e17d8b00 (diff) | |
Add `Math.log1p` and `Math.expm1`
This commit adds two new methods to the `Math` module:
* `Math.log1p(x)`: Computes `Math.log(x + 1)`
* `Math.expm1(x)`: Computes `Math.exp(x) - 1`
These methods are often more accurate than the straightforward
computation, especially when `x` is close to zero.
The corresponding functions, `log1p` and `expm1`, are defined in the C99
standard math library.
[Feature #21527]
Diffstat (limited to 'spec/ruby/shared/kernel')
0 files changed, 0 insertions, 0 deletions
