Table of contents Home page
$x = 0; // valid number if(is_nan($x)) { echo "The value of \$x ($x) is not a valid number.\n"; // Never executed } else { echo "The value of \$x ($x) is a valid number.\n"; } $x = log(0); // evaluates to INF, which is a valid number if(is_nan($x)) { echo "The value of \$x ($x) is not a valid number.\n"; // Never executed } else { echo "The value of \$x ($x) is a valid number.\n"; } $x = asin(2); // An argument greater than 1 is meaningless for asin() and the result is NAN if(is_nan($x)) { echo "The value of \$x ($x) is not a valid number.\n"; } else { echo "The value of \$x ($x) is a valid number.\n"; // Never executed }