[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modulo
- From: "Patrick Donnelly" <batrick.donnelly@...>
- Date: Wed, 3 Oct 2007 18:03:09 -0600
On 10/3/07, David Kastrup <dak@gnu.org> wrote:
> Huh? This relation is satisfied by Lua. Where is the disagreement?
What I meant by "correctly" was that Lua did it correctly where C and
others do it incorrectly, and that mathematicians would disagree with
that assertion.
>> So, was there a reason why? Personally I'm pretty happy it was
>> defined the way it was.
>
>Well, it goes nicely with math.floor(a/b).
Well, as I understand it, it was implemented that way in C because
that's how it's done in the hardware. I don't see why math.floor()
makes a good reason when Lua could have just used the C expression a %
b to evaluate the same expression in Lua.
--
-Patrick Donnelly
"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."
-Will Durant