Reimplement 'inexact->exact' to avoid mpq functions.
authorMark H Weaver <mhw@netris.org>
Mon, 4 Mar 2013 23:42:27 +0000 (18:42 -0500)
committerMark H Weaver <mhw@netris.org>
Tue, 12 Mar 2013 19:39:34 +0000 (15:39 -0400)
commit24475b860b02880b1cfdf4e03f9659a8af09eb72
tree8d2fa005f928865b2f96d3b5502e40f4bda253bb
parent7f34acd8a48198c7fec2daf8d2f4161eaa9963ec
Reimplement 'inexact->exact' to avoid mpq functions.

* libguile/numbers.c (scm_inexact_to_exact): Implement conversion of a
  double to an exact rational without using the mpq functions.

* test-suite/tests/numbers.test (dbl-mant-dig): Simplify initializer.
  (dbl-epsilon, dbl-min-exp): New variables.
  ("inexact->exact"): Add tests.  Fix broken "2.0**i to exact and back"
  test, and change it to "2.0**i to exact", to avoid use of
  'exact->inexact'.
libguile/numbers.c
test-suite/tests/numbers.test