[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
guile/guile-core/libguile numbers.c
From: |
Marius Vollmer |
Subject: |
guile/guile-core/libguile numbers.c |
Date: |
Mon, 06 May 2002 18:33:10 -0400 |
CVSROOT: /cvsroot/guile
Module name: guile
Changes by: Marius Vollmer <address@hidden> 02/05/06 18:33:10
Modified files:
guile-core/libguile: numbers.c
Log message:
From John W. Eaton.
* numbers.h: Conditionally include floatingpoint.h, ieeefp.h, and
nan.h. Provide declarations for scm_inf_p, scm_nan_p, scn_inf,
and scm_nan.
* numbers.c: [SCO && ! HAVE_ISNAN] (isnan): New function.
[SCO && ! HAVE_ISINF] (isinf): New function.
(xisinf, xisnan): New functions.
(IS_INF): Delete.
(isfinite): Define in terms of xisinf.
(scm_inf_p, scm_nan_p): New functions.
(guile_Inf, guile_NaN): New file-scope vars.
(guile_ieee_init): New function.
(scm_inf, scm_nan): New functions.
(idbl2str): Handle Inf and NaN. Remove funny label and
corresponding gotos.
(ALLOW_DIVIDE_BY_ZERO): New macro.
(scm_divide): Allow division by zero to occur if
ALLOW_DIVIDE_BY_ZERO is defined.
Handle bignums and ints as special cases.
Additional stuff by me:
numbers.c (mem2ureal): Recognize "inf.0" and "nan.xxx".
(scm_even_p, scm_odd_p): Treat infinity as even and odd.
(iflo2str): Don't output a '+' for negative numbers or for Inf and
NaN. They will provide their own sign.
(scm_divide): Only allow divides by inexact zeros. Dividing by
exact zeros still signals an errors.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile/guile-core/libguile/numbers.c.diff?tr1=1.160&tr2=1.161&r1=text&r2=text
- guile/guile-core/libguile numbers.c,
Marius Vollmer <=