Re: cvs: php4 /ext/standard formatted_print.c

From: Date: Mon, 14 Aug 2000 10:51:04 +0000
Subject: Re: cvs: php4 /ext/standard formatted_print.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1171@lists.php.net to get a copy of this message
On Mon, 14 Aug 2000, Stanislav Malyshev wrote: > stas Mon Aug 14 03:02:14 2000 EDT > > Modified files: > /php4/ext/standard formatted_print.c > Log: > Fix non-numbers printing (#6142) > # Please, somebody knowing about floats - check if there's more non-numbers > # seems we should check for all of them > > > Index: php4/ext/standard/formatted_print.c > diff -u php4/ext/standard/formatted_print.c:1.23 php4/ext/standard/formatted_print.c:1.24 > --- php4/ext/standard/formatted_print.c:1.23 Thu Jul 20 20:21:56 2000 > +++ php4/ext/standard/formatted_print.c Mon Aug 14 03:02:14 2000 > @@ -16,7 +16,7 @@ > +----------------------------------------------------------------------+ > */ > > -/* $Id: formatted_print.c,v 1.23 2000/07/21 03:21:56 coar Exp $ */ > +/* $Id: formatted_print.c,v 1.24 2000/08/14 10:02:14 stas Exp $ */ > > #include <math.h> /* modf() */ > #include "php.h" > @@ -252,6 +252,39 @@ > } else if (precision > MAX_FLOAT_PRECISION) { > precision = MAX_FLOAT_PRECISION; > } > + > + if( > +#if defined(HAVE_ISNAN) > + isnan(number) > +#elif defined(NAN) > + number == NAN > +#else > + 0 > +#endif Yuck, how about defining a separate PHP_ISNAN(f) (same for isinf) macro which performs these checks? That could be used in other places and avoids repeating this ugly mess. - Sascha

« previous php.cvs (#1171) next »