Fix bugs in `rationalize'
authorMark H Weaver <mhw@netris.org>
Tue, 1 Feb 2011 10:19:24 +0000 (05:19 -0500)
committerAndy Wingo <wingo@pobox.com>
Tue, 1 Feb 2011 20:08:52 +0000 (21:08 +0100)
commit605f698026db9e4e8af4454bc1ae09f6e97b4218
treea1f854628e0f65caeb7cbf86926a391ff01cf0fd
parent820381bc7fd7d6ff4efe070853190d4b48bc5fc0
Fix bugs in `rationalize'

* libguile/numbers.c (scm_rationalize): Fix bugs.  Previously, it
  returned exact integers unmodified, although that was incorrect if
  the epsilon was at least 1 or inexact, e.g. (rationalize 4 1) should
  return 3 per R5RS and R6RS, but previously it returned 4.  Also
  handle cases involving infinities and NaNs properly, per R6RS.

* test-suite/tests/numbers.test: Add test cases for `rationalize'.

* NEWS: Add NEWS entry
NEWS
libguile/numbers.c
test-suite/tests/numbers.test