We quickly discussed this issue at today's Ruby committer's meeting.
For everybody, converting exponential (scientific) notation to integer looked strange. Exponential notation is usually used to express very large numbers or very small numbers that don't fit integer.
We also wondered whether you have an actual use case. Consistency is important, but we don't add something just for 'consistency's sake.
We also wondered whether you have an actual use case.
I stumbled across this behavior when playing with a simple calculator which collects user input via:
number=Integer(gets)
Exponential notation is usually used to express very large numbers or very small numbers that don't fit integer.
I'd remove the "that don't fit integer" part, but yes, it's a way to enter and display very large (or very small) numbers more concise. That's exactly was I was attempting: entering 1e30, so I don't have to type 1000000000000000000000000000000.
Consistency is important, but we don't add something just for 'consistency's sake.
The documentation for Kernel#Integer explains that "[...] strings should be strictly conformed to numeric representation". Shouldn't it in turn be able to parse for example "1e30", given that 1e30is a valid numeric representation?
I think it's more a matter of completeness than consistency. It seems odd that Integer() happily parses '0xff', '0b100110' and '0740' but cannot handle '1e30'.