我對warnings
附註不抱怨「NaN」和「nan」是非數字的事實感到有點驚訝(也很害怕)。爲什麼根據警告編譯指示'NaN'數字?
爲什麼warnings
對他們沒有排出習慣'Argument isn't numeric in addition (+)
?
測試用例
$ perl -Mstrict -wE 'say 0+$_ for qw/string NaN nan fail/;'
Argument "string" isn't numeric in addition (+) at -e line 1.
0
0
0
Argument "fail" isn't numeric in addition (+) at -e line 1.
0
http://en.wikipedia.org/wiki/NaN'NaN'是一個浮點數的有效值,就像+/-無窮大一樣。 – biziclop 2012-07-05 13:58:55