1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 15:00:21 +02:00

Clarify feature macro conditionals.

* libguile/numbers.c (scm_log10): Check whether `HAVE_COMPLEX_DOUBLE'
  and `HAVE_CLOG10' are defined instead of checking whether they are
  non-zero.
  (scm_sqrt): Likewise for `HAVE_COMPLEX_DOUBLE' and
  `HAVE_USABLE_CSQRT'.
This commit is contained in:
Ludovic Courtès 2010-09-08 00:38:49 +02:00
parent 2e65b52f8a
commit f328f86230

View file

@ -6440,7 +6440,8 @@ SCM_DEFINE (scm_log10, "log10", 1, 0, 0,
/* Mingw has clog() but not clog10(). (Maybe it'd be worth using /* Mingw has clog() but not clog10(). (Maybe it'd be worth using
clog() and a multiply by M_LOG10E, rather than the fallback clog() and a multiply by M_LOG10E, rather than the fallback
log10+hypot+atan2.) */ log10+hypot+atan2.) */
#if HAVE_COMPLEX_DOUBLE && HAVE_CLOG10 && defined (SCM_COMPLEX_VALUE) #if defined HAVE_COMPLEX_DOUBLE && defined HAVE_CLOG10 \
&& defined SCM_COMPLEX_VALUE
return scm_from_complex_double (clog10 (SCM_COMPLEX_VALUE (z))); return scm_from_complex_double (clog10 (SCM_COMPLEX_VALUE (z)));
#else #else
double re = SCM_COMPLEX_REAL (z); double re = SCM_COMPLEX_REAL (z);
@ -6506,7 +6507,8 @@ SCM_DEFINE (scm_sqrt, "sqrt", 1, 0, 0,
{ {
if (SCM_COMPLEXP (x)) if (SCM_COMPLEXP (x))
{ {
#if HAVE_COMPLEX_DOUBLE && HAVE_USABLE_CSQRT && defined (SCM_COMPLEX_VALUE) #if defined HAVE_COMPLEX_DOUBLE && defined HAVE_USABLE_CSQRT \
&& defined SCM_COMPLEX_VALUE
return scm_from_complex_double (csqrt (SCM_COMPLEX_VALUE (x))); return scm_from_complex_double (csqrt (SCM_COMPLEX_VALUE (x)));
#else #else
double re = SCM_COMPLEX_REAL (x); double re = SCM_COMPLEX_REAL (x);