armedbear / abcl

Armed Bear Common Lisp <git+https://github.com/armedbear/abcl/> <--> <svn+https://abcl.org/svn> Bridge
https://abcl.org#rdfs:seeAlso<https://gitlab.common-lisp.net/abcl/abcl>
Other
288 stars 29 forks source link

Reading 694656019000000000.0d0 yields 0.0d0 #662

Closed alanruttenberg closed 6 months ago

alanruttenberg commented 7 months ago

By comparison (* 694656019000000000 1.0d0) -> 6.94656019d17

easye commented 6 months ago

For a <file:~xx> whose contents are

694656019000000000.0d0

yields

CL-USER> (with-open-file (i #p"~/xx" :direction :input) (read i)) 6.94656019d17

I can read a serialized version from a stream of file bytes, ok. How are you abusing READ?

alanruttenberg commented 6 months ago

Slime repl. Played around and definitely not a lisp issue, sorry about that. What happened was I copy-pasted the long part 694656019000000000 then added .0d0 at the end. But the long was a repl result (italicized) and for some reason it read that separately. So two things read: 694656019000000000 then 0.0d0 , and hence 0.0d0 result since it was last.