`equal?' and `eqv?' are now equivalent for numbers
Change `equal?' to work like `eqv?' for numbers.
Previously they worked differently in some cases, e.g.
when comparing signed zeroes or NaNs. For example,
(equal? 0.0 -0.0) returned #t but (eqv? 0.0 -0.0)
returned #f, and (equal? +nan.0 +nan.0) returned #f
but (eqv? +nan.0 +nan.0) returned #t.
* libguile/numbers.c (scm_real_equalp, scm_bigequal,
scm_complex_equalp, scm_i_fraction_equalp): Move to eq.c.
* libguile/eq.c (scm_real_equalp): Compare flonums using
real_eqv instead of ==, so that NaNs are now considered
equal, and to distinguish signed zeroes.
(scm_complex_equalp): Compare real and imaginary
components using real_eqv instead of ==, so that NaNs are
now considered equal, and to distinguish signed zeroes.
(scm_bigequal): Use scm_i_bigcmp instead of duplicating it.
(real_eqv): Test for NaNs using isnan(x) instead of
(x != x), and use SCM_UNLIKELY for optimization.
(scm_eqv_p): Use scm_bigequal, scm_real_equalp,
scm_complex_equalp, and scm_i_fraction_equalp to compare
numbers, instead of inline code. Those predicates now do
what scm_eqv_p formerly did internally. Replace if
statements with switch statements, as is done in
scm_equal_p. Remove useless code to check equality of
fractions with different SCM_CELL_TYPEs; this was for a
tentative "lazy reduction bit" which was never developed.
(scm_eqv_p, scm_equal_p): Remove useless code to check
equality between inexact reals and non-real complex numbers
with zero imaginary part. Such numbers do not exist,
because the current code is careful to never create them.
* test-suite/tests/numbers.test: Add test cases for
`eqv?' and `equal?'. Change existing test case for
`(equal? +nan.0 +nan.0)' to expect #t instead of #f.
* NEWS: Add NEWS entries.