mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
- MF52: #42143, the constant NAN is reported as 0 on Windows
This commit is contained in:
parent
133296f962
commit
469d4938fc
38
Zend/tests/bug42143.phpt
Normal file
38
Zend/tests/bug42143.phpt
Normal file
@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
bug #42143 (The constant NAN is reported as 0 on Windows build)
|
||||
--CREDITS--
|
||||
Venkat Raman Don
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Testing NAN:\n";
|
||||
echo "NAN= ";
|
||||
var_dump(NAN);
|
||||
var_dump(tan(-1) == 123);
|
||||
var_dump(cos(-100) == "PHP String");
|
||||
var_dump(deg2rad(-5.6) == null);
|
||||
var_dump(sqrt(-0.1) == false);
|
||||
var_dump(sqrt(cos(M_PI)) == 0.1);
|
||||
var_dump(NAN);
|
||||
var_dump(is_nan(sqrt(-1.005)) == false);
|
||||
var_dump(is_nan(floor(1)) == true);
|
||||
var_dump(log10(-1) == log(-1));
|
||||
var_dump(log10(-1) != log10(-1));
|
||||
var_dump(is_finite(log10(-1)) == false);
|
||||
var_dump(NAN == NAN);
|
||||
?>
|
||||
--EXPECT--
|
||||
Testing NAN:
|
||||
NAN= float(NAN)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
float(NAN)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
@ -160,7 +160,7 @@
|
||||
|
||||
#undef HAVE_ATOF_ACCEPTS_NAN
|
||||
#undef HAVE_ATOF_ACCEPTS_INF
|
||||
#define HAVE_HUGE_VAL_NAN 1
|
||||
#define HAVE_HUGE_VAL_NAN 0
|
||||
|
||||
/* vs.net 2005 has a 64-bit time_t. This will likely break
|
||||
* 3rdParty libs that were built with older compilers; switch
|
||||
|
Loading…
Reference in New Issue
Block a user