parse-float icon indicating copy to clipboard operation
parse-float copied to clipboard

5e is not a valid float but parsed

Open egao1980 opened this issue 5 years ago • 6 comments

CL-USER> (parse-float:parse-float "5e")
5.0
2 (2 bits, #x2, #o2, #b10)

egao1980 avatar Apr 27 '20 19:04 egao1980

Is it a bug or is it a feature?

ikrabbe avatar Jan 13 '21 12:01 ikrabbe

It's a bug as exponent should be present if 'e' is specified.

egao1980 avatar Jan 13 '21 12:01 egao1980

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.

ikrabbe avatar Apr 01 '21 06:04 ikrabbe

My point is that 0 is not the default here. Exponent is mandatory after 'e'. It is so in CL and many other languages.

egao1980 avatar Apr 05 '21 16:04 egao1980