From: Pascal B. <pj...@in...> - 2005-07-22 22:13:04
|
Matthias Buelow writes: > Pascal Bourguignon <pj...@in...> writes: > > >> [1]> (- 1.1 0.9) > >> 0.20000005 > >Common Lisp is a _practical_ language. Therefore in some aspects it's > >very high level (it has rational numbers), but in other aspects it's > >designed to be efficient on available hardware therefore it is > >specified to use floating-point numbers. And for good or for evil, > >the reader syntax 1.1 and 0.9 correspond to floating-point numbers. > >When you write 1.1 or 0.9, you DON'T get 11/10 or 9/10. > >You get: 3F8CCCCD and 3F666666 (hex) > > Doesn't clisp use C doubles internally? Not by default: [8]> (- 1.1s0 0.9s0) 0.200005s0 [9]> (- 1.1e0 0.9e0) 0.20000005 [10]> (- 1.1d0 0.9d0) 0.20000000000000007d0 [11]> (- 1.1l0 0.9l0) 0.20000000000000000004L0 [12]> (- 1.1 0.9) 0.20000005 (and setting CUSTOM:*DEFAULT-FLOAT-FORMAT* doesn't seem to have effect in 2.33.83). -- __Pascal Bourguignon__ http://www.informatimago.com/ Cats meow out of angst "Thumbs! If only we had thumbs! We could break so much!" |