parse-float
parse-float copied to clipboard
Parse a floating point value from a string in Common Lisp.
In general, it seems that some numbers just don't parse correctly, at least under latest SBCL. I assume this is due to a quirk in the IEEE 754 Float representation,...
```lisp CL-USER> (parse-float:parse-float "5e") 5.0 2 (2 bits, #x2, #o2, #b10) ```
Hi I've noticed this issue ``` WARNING: System definition file #P"/gnu/store/zabqd3b62xwxx5kfmvz7hdc0fjlb5c8l-sbcl-parse-float-0.0.0-2.3074765/share/common-lisp/sbcl/parse-float/parse-float.asd" contains definition for system "parse-float-tests". Please only define "parse-float" and secondary systems wit h a name starting with "parse-float/"...
It's possible to do more comprehensive testing with randomized tests. Something like ``` (let ((r (random most-positive-double-float))) (= r (parse-float:parse-float (prin1-to-string r) :type 'double-float :exponent-character #\d))) ```
this should make compilation quieter; I only tested this on one deployment, that already had the ASDF system registered, and thus might not have caught some edge cases from different...