[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why do some math functions return -0
- From: Tony Finch <dot@...>
- Date: Mon, 20 Sep 2010 13:25:36 +0100
On Mon, 20 Sep 2010, David Kastrup wrote:
> Tony Finch <dot@dotat.at> writes:
> > On 20 Sep 2010, at 09:18, David Kastrup <dak@gnu.org> wrote:
> > > Tony Finch <dot@dotat.at> writes:
> > > >
> > > > It can happen if the rounding mode is towards negative
> > > > infinity.
> > >
> > > Please point out the line in question where this would apply.
> >
> > There are lots of subtractions in the code.
>
> Hogwash.
Have a look at the Lua reference manual:
Modulo is defined as
a % b == a - math.floor(a/b)*b
That is, it is the remainder of a division that rounds the
quotient towards minus infinity.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
HUMBER THAMES DOVER WIGHT PORTLAND: NORTH BACKING WEST OR NORTHWEST, 5 TO 7,
DECREASING 4 OR 5, OCCASIONALLY 6 LATER IN HUMBER AND THAMES. MODERATE OR
ROUGH. RAIN THEN FAIR. GOOD.
- References:
- Why do some math functions return -0, Mike McGonagle
- Re: Why do some math functions return -0, Drake Wilson
- Re: Why do some math functions return -0, Mike McGonagle
- Re: Why do some math functions return -0, caseyh
- Re: Why do some math functions return -0, David Kastrup
- Re: Why do some math functions return -0, HyperHacker
- Re: Why do some math functions return -0, KHMan
- Re: Why do some math functions return -0, HyperHacker
- Re: Why do some math functions return -0, David Kastrup
- Re: Why do some math functions return -0, Tony Finch
- Re: Why do some math functions return -0, David Kastrup
- Re: Why do some math functions return -0, Tony Finch
- Re: Why do some math functions return -0, David Kastrup