[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A small practical example where Lua’s % behavior is better than C’s
- From: Joseph Wallace <tangent128@...>
- Date: Mon, 20 Apr 2015 20:58:52 -0400
On 04/18/2015 06:38 PM, Hisham wrote:
> I just wrote this, and thought that some of you might enjoy.
>
> http://hisham.hm/2015/04/18/a-small-practical-example-where-luas-behavior-is-better-than-cs/
>
> -- Hisham
>
Indeed, I once spent hours at a game jam debugging that exact same issue
while trying to wrap sprites.
At least in my usage, % is used for "wrapping" an array at least ten
times as often as getting the mathematical modulo.
And floored modulo just plain graphs tidier:
https://en.wikipedia.org/wiki/File:Divmod.svg
~Joseph Wallace