`a % b`

to calculate a modulo, and sometimes `LModulo(a, b)`

(where a and b are both Int32 variables or values).Obviously, the

`LModulo`

is defined in the Cinema 4D SDK and thus preferred. But what is the benefit of using it over the regular modulus operator, or put differently, what are the cons of using the modulus operator?
Just wondering.

]]>`a % b`

to calculate a modulo, and sometimes `LModulo(a, b)`

(where a and b are both Int32 variables or values).Obviously, the

`LModulo`

is defined in the Cinema 4D SDK and thus preferred. But what is the benefit of using it over the regular modulus operator, or put differently, what are the cons of using the modulus operator?
Just wondering.

]]>With regard to the LModulo function, being it part of the cinema.framework, you can see, by looking at the implementation, that it:

- it's the specialized version for integers with either
`Int32`

or`Int64`

parameters' data-type; - handles properly the case of the first argument being negative;
- handles gracefully the case where the second argument is zero.

The code, available in the framework is:

```
if (!b)
return 0;
if (a >= 0)
return a % b;
a -= (a / b) * b;
if (a < 0)
a += b;
return a;
```

Cheers, Riccardo

]]>