--- numbers.c.~1.206.~ 1970-01-01 10:00:01.000000000 +1000 +++ numbers.c 2003-11-13 08:31:33.000000000 +1000 @@ -468,7 +468,14 @@ return x; } else if (SCM_REALP (x)) - return scm_make_real (fabs (SCM_REAL_VALUE (x))); + { + /* note that if x is a NaN then xx<0 is false so we return x unchanged */ + double xx = SCM_REAL_VALUE (x); + if (xx < 0.0) + return scm_make_real (-xx); + else + return x; + } else SCM_WTA_DISPATCH_1 (g_scm_abs, x, 1, s_scm_abs); }