Here's output from gdb that shows the problem. The negative value -NaN of "x" is the value of "guile_NaN", which is calculated with the expression "guile_NaN = guile_Inf / guile_Inf" in numbers.c on BSD. The positive value NaN of "y" is the result of 0.0/0.0.
test_9 (val=NaN(0x8000000000000), result=0x3c00089e "+nan.0") at test-conversion.c:785
Breakpoint 3, real_eqv (x=-NaN(0x8000000000000), y=NaN(0x8000000000000)) at eq.c:61
Here's a version of real_eqv that works correctly on BSD:
static int
real_eqv (double x, double y)
{
return !memcmp (&x, &y, sizeof(double)) || (x != x && y != y);
}Since NaN != NaN, the expression "(x != x && y != y)" is true if "x" and "y" are both NaNs.
_______________________________________________ Bug-guile mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-guile
