/[guile]/guile/guile-core/libguile/numbers.c
ViewVC logotype

Diff of /guile/guile-core/libguile/numbers.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.213 by kryde, Fri Nov 21 00:03:54 2003 UTC revision 1.214 by kryde, Fri Nov 21 00:07:13 2003 UTC
# Line 641  SCM_PRIMITIVE_GENERIC (scm_abs, "abs", 1 Line 641  SCM_PRIMITIVE_GENERIC (scm_abs, "abs", 1
641          return x;          return x;
642      }      }
643    else if (SCM_REALP (x))    else if (SCM_REALP (x))
644      return scm_make_real (fabs (SCM_REAL_VALUE (x)));      {
645          /* note that if x is a NaN then xx<0 is false so we return x unchanged */
646          double xx = SCM_REAL_VALUE (x);
647          if (xx < 0.0)
648            return scm_make_real (-xx);
649          else
650            return x;
651        }
652    else if (SCM_FRACTIONP (x))    else if (SCM_FRACTIONP (x))
653      {      {
654        if (SCM_FALSEP (scm_negative_p (SCM_FRACTION_NUMERATOR (x))))        if (SCM_FALSEP (scm_negative_p (SCM_FRACTION_NUMERATOR (x))))

Legend:
Removed from v.1.213  
changed lines
  Added in v.1.214

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26