[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trunc



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.
--Guy