-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
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, or similar. I believe this snippet neatly explains the issue:
CL-USER> (lisp-implementation-type)
"SBCL"
CL-USER> (lisp-implementation-version)
"2.1.9"
CL-USER> (ql:system-apropos "parse-float")
#<SYSTEM parse-float / parse-float-20200218-git / quicklisp 2021-08-07>
#<SYSTEM parse-float-tests / parse-float-20200218-git / quicklisp 2021-08-07>
; No value
CL-USER> (parse-float:parse-float "4.78")
4.7799997
4
CL-USER> (parse-float:parse-float "5.78")
5.7799997
4
CL-USER> (parse-float:parse-float "6.78")
6.7799997
4
CL-USER> (parse-float:parse-float "7.78")
7.7799997
4
CL-USER> (parse-float:parse-float "8.78")
8.78
4
CL-USER> (parse-float:parse-float "9.78")
9.78
4
CL-USER> (parse-float:parse-float "10.78")
10.78
5
I'm of the opinion that the string "4.78" should parse to the number 4.78, rather than 4.7799997, and that the expected behaviour is that shown when parsing the string "9.78", such as when using read-from-string as such:
CL-USER> (read-from-string "7.78")
7.78
4
Metadata
Metadata
Assignees
Labels
No labels