4 ms·
This is what happens: "3.9e3".to_i => 3 and Integer("3.9e3") raises "invalid value for Integer()". Really, nothing to see here. Ruby just doesn't treat "3.9
by radiospiel 4y ago
This is what happens:
"3.9e3".to_i => 3
and
Integer("3.9e3")
raises "invalid value for Integer()". Really, nothing to see here. Ruby just doesn't treat "3.9e3" as a valid string for an integer (which arguably is correct IMHO)