Fix rounding in scm_i_divide2double for negative arguments.
authorMark H Weaver <mhw@netris.org>
Tue, 16 Jul 2013 04:00:23 +0000 (00:00 -0400)
committerMark H Weaver <mhw@netris.org>
Tue, 16 Jul 2013 04:00:23 +0000 (00:00 -0400)
commit4cc2e41cf78bccf13d7dfc44f74b7c11d13dbf33
tree3384e1fe69cac36dcf348afdee457c366a3eb3f0
parent7e8166f5bdb526c021c826943aaf050134cccc83
Fix rounding in scm_i_divide2double for negative arguments.

* libguile/numbers.c (INUM_LOSSLESSLY_CONVERTIBLE_TO_DOUBLE):
  New macro.
  (scm_i_divide2double): Use INUM_LOSSLESSLY_CONVERTIBLE_TO_DOUBLE to
  determine if our fast path is safe.  Previously, negative arguments
  were not checked properly.

* test-suite/tests/numbers.test (exact->inexact): Add tests.
libguile/numbers.c
test-suite/tests/numbers.test