|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-31 11:42 UTC] jani@php.net
[2007-08-02 09:47 UTC] pajoye@php.net
[2007-08-02 22:27 UTC] stas@php.net
[2007-08-03 05:24 UTC] pajoye@php.net
[2008-07-18 16:24 UTC] jani@php.net
[2009-05-24 11:57 UTC] php-lists at stanvassilev dot com
[2009-05-24 12:45 UTC] php-lists at stanvassilev dot com
[2009-05-24 12:58 UTC] php-lists at stanvassilev dot com
[2009-05-29 08:18 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
Description: ------------ The constant NAN is reported as '0' on the Windows binary downloaded from the snaps.php.net site. The function is correct on Linux. A colleague built locally (on Windows) from source and got the correct value for NAN (ie NAN). We stepped through this code (in basic_functions.c): PHPAPI double php_get_nan(void) { #if HAVE_HUGE_VAL_NAN return HUGE_VAL + -HUGE_VAL; #elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha) double val = 0.0; ((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH; ((php_uint32*)&val)[0] = 0; return val; #elif HAVE_ATOF_ACCEPTS_NAN return atof("NAN"); #else return 0.0/0.0; #endif } and found that the local build goes through the first "if" section, that is, HAVE_HUGE_VAL_NAN is true. We can't step through the Windows binary we downloaded but guessing that it's not executing the same section. Reproduce code: --------------- <?php echo "NAN= "; var_dump(NAN); ?> Expected result: ---------------- NAN= float(NAN) Actual result: -------------- NAN= float(0)