[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua_number2integer
- From: David Given <dg@...>
- Date: Thu, 25 Sep 2008 18:08:22 +0100
Mike Pall wrote:
> r=a%b; d=(a-r)/b | 3.76 | 0.84 |
Is LuaJIT intelligent enough to spot a % and / near each other and
optimise them into a single divide-with-remainder operation?
> Well ... maybe Lua needs a floor-division operator '//'?
It is the *one* thing that's missing from a all-numbers-are-doubles
system; all the other arithmetic operations are fundamentally the same
for both types, but division isn't.