Posted at

配列の inf 番目の要素は?

More than 5 years have passed since last update.

$ perl -e 'print [0,1,2,3,4]->[0+"inf"]'

4

$ perl -e 'print [0,1,2,3,4]->[0+"-inf"]'

0

$ perl -e 'print [0,1,2,3,4]->[0+"nan"]'

0

$ perl -e 'print [0,1,2,3,4]->[0+"hoge"]'

0

$ perl -e 'print [0,1,2,3,4]->[-0**1]'

0