New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CEM mod #288
Comments
|
The expressions are operating only on float values and % is not defined for floats. |
|
What about |
|
Practically the same, but it does not work for negative X. |
|
The Lua version is saner than the Java version. Let me look up that paper or w/e it was... |
|
Meh, couldn't find it... |
|
Thanks to the Lua mailing list I found these: http://hisham.hm/2015/04/18/a-small-practical-example-where-luas-behavior-is-better-than-cs/ (this is the one I was talking about) https://www.microsoft.com/en-us/research/publication/division-and-modulus-for-computer-scientists/ |
|
Not sure which one should be implemented. |
|
Lua has math.fmod as Java's (well C's really) |
|
For me defining "%" like Java and "mod" like Lua is the better way. Most other languages (except Lua) define "%" in the C/Java way (the result sign differs a bit). Most of the time "%" is used as "x % y == 0" in order to trigger an action every "y" steps. For this usage both implementation are working correctly and the practical difference will be minimal. Java has the Lua mod as Math.floorMod() so I could use "fmod" for it. |
|
Added:
|
The
%operator is missing.The text was updated successfully, but these errors were encountered: