parse-float
parse-float copied to clipboard
5e is not a valid float but parsed
CL-USER> (parse-float:parse-float "5e")
5.0
2 (2 bits, #x2, #o2, #b10)
Is it a bug or is it a feature?
It's a bug as exponent should be present if 'e' is specified.
I find it hard to think of an input parser that has problems because a easily guessable default value is missing. In this case the default is 0 of course.
My point is that 0 is not the default here. Exponent is mandatory after 'e'. It is so in CL and many other languages.