Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: jeanfabre on June 19, 2013, 03:32:11 AM

Title: Float Modulo
Post 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
Title: Re: Float Modulo
Post by: Ryandb2 on July 30, 2016, 03:59:59 PM
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.
Title: Re: Float Modulo
Post by: jeanfabre on August 01, 2016, 05:21:10 AM
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
Title: Re: Float Modulo
Post by: jeanfabre on August 01, 2016, 05:24:17 AM
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