Closed agentultra closed 10 years ago
The operator is not broken. This is how most every programming language defines the % operator to work for signed integers / floats. The only exception I can think of is Python
My bad. It's remainder and not modulo.
Sent from my mobile
On May 16, 2014, at 4:50 PM, Luca Deltodesco notifications@github.com wrote:
The operator is not broken. This is how most every programming language defines the % operator to work for signed integers / floats. The only exception I can think of is Python
— Reply to this email directly or view it on GitHub.
Turns out you can add Perl and Ruby to that list too.
The % operator in Javascript is broken, see http://javascript.about.com/od/problemsolving/a/modulobug.htm
I assume this is rather well-known among Javascript apologists but I was not expecting it as a haxe user who is used to other platforms where the operator isn't broken.
It'd be nice if the js backend could insert the fix in the generated code or provide a workaround to use it explicitly.