[Openmcl-devel] Probably a stupid question...
Duncan Rose
duncan at robotcat.demon.co.uk
Sat Aug 6 06:11:09 PDT 2005
... but. I don't understand some behaviour I've observed (I can't see
anything in the hyperspec to explain it but often seem to miss what I'm
looking for in there).
I'm using 0.14.3 on OS 10.2:
CL-USER> (type-of 123456.984537)
SINGLE-FLOAT
CL-USER> (truncate 123456.984537)
123456
0.984375
CL-USER> (type-of 1234561.984537)
SINGLE-FLOAT
CL-USER> (truncate 1234561.984537)
1234562
0.0
CL-USER>
Should the second truncate really be returning those values (should the
first? the remainder isn't right, surely...)? And assuming the answer
is 'yes' could anybody enlighten me as to why this is? It appears to
violate the description in the hyperspec, namely:
"These functions divide number by divisor, returning a quotient and
remainder, such that
quotient*divisor+remainder=number"
LispWorks returns the same results as OpenMCL for me so I presume I'm
just overlooking something...
Thanks,
-Duncan
More information about the Openmcl-devel
mailing list