[Openmcl-devel] Probably a stupid question...

Duncan Rose duncan at robotcat.demon.co.uk
Sat Aug 6 06:48:07 PDT 2005


On Saturday, August 6, 2005, at 02:11  pm, Duncan Rose wrote:

-->8-- snipped -->8--

> 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"

(= (multiple-value-bind (quotient remainder)
			   (truncate 1234561.981)
			 (+ quotient remainder))
		       1234561.981)

=> T, so even though the quotient isn't of 'the greatest integral 
magnitude not greater than the mathematical quotient' (not to the human 
reader at least) I think I was overlooking the usual issues of internal 
floating point representation (a bad habit I really need to get out of).

CL-USER> 1234561.981 => 1234562.0

D'oh!

-Duncan



> LispWorks returns the same results as OpenMCL for me so I presume I'm 
> just overlooking something...
>
>
> Thanks,
>
> -Duncan
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>




More information about the Openmcl-devel mailing list