2

Ok, I'm stuck. I have this PHP code:

    echo exp(12), '<br/>';
    echo exp(4.2);

just like on the PHP.net page. And what I have on the screen:

    NAN
    298.86740096706

but then there comes the weirdest thing ever. I thought that maybe there's some PHP.ini problem with numbers like 2.67e8 and so (I mean with the 'e' inside) or something. But then, when I changed the above code into:

    echo (2.67e8), '<br/>';
    echo exp(4.2);

suddenly I saw this whatever:

    267000000
    NAN

It's kind of WTF especially because of the last NAN, when first it was a quite normal, calm float 298.86740096706 but then just with no reason it went to hell replaced by NAN. Do you have any ideas? Please?

4

1 回答 1

0

如果为真,这一定是您的 PHP 版本中的错误。请报告

顺便说一句,我无法在 PHP 5.3.2 上重现它。跑步:

php -r 'do { $c = exp(4.2); echo "point "; } while (is_nan($c)); echo "$c\n";'

产生预期的输出:

point 66.686331040925
于 2012-05-11T22:36:23.030 回答