summaryrefslogtreecommitdiff
path: root/libguile/bytevectors.c
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2011-02-15 10:37:03 -0500
committerLudovic Courtès <ludo@gnu.org>2011-02-16 00:47:34 +0100
commit05f167beb213e34a3ae849e0008c6fad0871e6ae (patch)
tree6745fb62b53ea0d01a937531459d07a6b5f0d3fc /libguile/bytevectors.c
parent14a01ec1a87e0b21356ccd4d737263b8ec0eba13 (diff)
downloadguile-05f167beb213e34a3ae849e0008c6fad0871e6ae.tar.gz
Improvements to `log' and `log10'
* libguile/numbers.c (log_of_shifted_double, log_of_exact_integer, log_of_exact_integer_with_size, log_of_fraction): New internal static functions used by scm_log and scm_log10. (scm_log, scm_log10): Robustly handle large integers, large and small fractions, and fractions close to 1. Previously, computing logarithms of fractions close to 1 yielded grossly inaccurate results, and the other cases yielded infinities even though the answer could easily fit in a double. (log -0.0) now returns -inf.0+<PI>i, where previously it returned -inf.0. (log 0) now throws a numerical overflow exception, where previously it returned -inf.0. (log 0.0) still returns -inf.0. Analogous changes made to `log10'. * test-suite/tests/numbers.test (log, log10): Add tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'libguile/bytevectors.c')
0 files changed, 0 insertions, 0 deletions