Floats are pretty hard, especially if you're accepting exponentiation:
- 1.4
- -1.4
- .4
- -.4
- 1.
- -1.
... plus exponents, also you don't need a decimal point if there's an exponent
Won't Ruby parse a string into a float? I would just use that and check for an error unless your requirements are different.