(coerce .2 'double-float)
it returns on Allegro 8.1 running under windows vista 32 bit
0.22200000286102295d0
Why is the new number different??? What's going on

CL-USER> (integer-decode-float .2d0)
7205759403792794
-55
1
CL-USER> (integer-decode-float .2)
13421773
-26
1
CL-USER> (/ 7205759403792794 13421773)
7205759403792794/13421773
CL-USER> (integer-decode-float (coerce .2 'double-float))
7205759511166976
-55
1
CL-USER> (/ 7205759511166976 13421773)
536870912
Harnon wrote:Sorry. (coerce .2 'double-float) produces
0.20000000298023224d0
(* .2 1d0) produces 0.20000000298023224d0
(* .2d0 .1d0) produces
0.020000000000000004d0
I think I will just stick to the float version of the c library. Thanks for the explanation!
(and double-floats can store all single-floats without loss)
CL-USER> (float .2 1d0)
0.20000000298023224d0
CL-USER> (float (float .2 1d0) 1.0)
0.2
CL-USER> (float .2d0 1.0)
0.2
Users browsing this forum: No registered users and 7 guests