Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: jeanfabre on June 19, 2013, 03:32:11 AM
-
Hi,
Following a post where float modulo was required, I created a custom action for it.
bye,
Jean
-
Just in case anyone is thinking of using this function, its worth noting this is not a modulo operation, but rather a remainder operation. % in C# is remainder which will present different results in negative divisor or dividend cases than a true modulo.
https://blogs.msdn.microsoft.com/ericlippert/2011/12/05/whats-the-difference-remainder-vs-modulus/
Stumbled on this as I was getting effectively invalid results for a typical mod operation.
-
Hi,
ok, very confusing indeed:
http://www.dotnetperls.com/modulo
So, where could I find some definite code on creating a modulo and a remainder.
Bye,
Jean
-
Hi,
found this: http://cc.davelozinski.com/c-sharp/use-the-modulus-operator-or-alternative
so, what would be a typical case to check that modulo and remainder are properly working?
Bye,
Jean