[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Earl A. Killian <Killian at MIT-MULTICS>
- Subject: Re: trunc
- From: Guy.Steele at CMU-10A
- Date: Thu, 08 Jul 1982 02:50:00 -0000
- Cc: common-lisp at SU-AI
- In-reply-to: Earl A. Killian@MIT-MULTICS's message of 7 Jul 82 16:20-EST
No, EAK, I think there's a bug in your complaint. Indeed most machines
divide so that sign of remainder equals sign of dividend. So 5/-2 must
yield a remainder of 1, not -1. To do that the quotient must be -2, not -3.
(Recall that dividend = quotient*divisor + remainder, so 5 = (-2)*(-2) + 1.)
So TRUNC does indeed match standard machine division.