svspire / mcl

Automatically exported from code.google.com/p/mcl
Other
1 stars 1 forks source link

Incorrect reading double float #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Welcome to Macintosh Common Lisp Version 5.2.1!
? (read-from-string "0.6146281499692686  ")
0.61462814
19

? (setf *READ-DEFAULT-FLOAT-FORMAT* 'double-float)
DOUBLE-FLOAT

? (read-from-string "0.6146281499692686  ")
0.6146281332167046                              <<<<<< WHAT?
19

? (read-from-string "0.9847365829640571 ")
0.9847365829640571
19

Original issue reported on code.google.com by terje.norderhaug on 16 Mar 2010 at 10:56

GoogleCodeExporter commented 8 years ago
I don't have a fix, but I did localize the problem to the FIDE function in 
numbers.lisp:

Problem localized to CCL::FIDE in numbers.lisp:

? (read-from-string "0.6146281499692686    ")
 Calling (CCL::PARSE-FLOAT "0.6146281499692686              " 18 0)
  Calling (CCL::FIDE 0 6146281499692686 -16 NIL)
  CCL::FIDE returned 0.6146281332167046
 CCL::PARSE-FLOAT returned 0.6146281332167046
0.6146281332167046
19

Original comment by terje.norderhaug on 16 Mar 2010 at 10:58