Also "NaN".to_f returns 0 instead of NaN.
Since Ruby 1.9.3 there is a constant to get the NaN value
Float::NAN => NaN
1.4m articles
1.4m replys
5 comments
57.0k users