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
2.1m questions
2.1m answers
60 comments
57.0k users