[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

floats



     I am having a *very* nasty problem. I want all my floats to be double. 
     Always. I set *default-float-format* to 'double-float, *and* set the 
     vars as 0.0d0. And still end up with numbers like 644151.75f0. I am 
     loosing precision and getting complex numbers instead of reals when 
     taking sqrt of -0.00000whatever which I get instead of +0.0d0 because 
     of loss of precision.
     
     The case in question is: 
     (let ((yy 0.0d0))
      (dolist (lambda (xx) (incf yy xx)) '(some list of floats)))
     (the floats in the list are read from a file, and I don't mind that 
     they are singles, although I don't understand why they are since I do 
     set *default-float-format*.)
     This can be traced to 
     
     > (+ 0.0d0 1233456.2345f0)
     
     1233456.3f0
     >
     
     which is quite outrageous, since *I* would expect it to be double on 
     the grounds of double + single = double no matter what! :-)
     
     What is going on?
     Please help!