Tag Link | [Math_Mod] | Category | Math |
---|---|---|---|
Type | Substitution | Source Available | No |
Support | Preferred | Version | 3.0 |
Change | Unchanged | Data Source | Any |
Output Type | Integer | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x |
[Math_Mod] returns the value of the first parameter modulo the second parameter, the remainder after the first parameter is divided into the second parameter.
Each parameter is cast to an integer or decimal value. The result is an integer if all the parameters were integers or a decimal otherwise.
Equivalent to performing a modulo operation using the % symbol except that the values passed in to the [Math_Mod] tag are automatically cast to numeric values.
[Math_Mod: Base Value, Modulus Value]
Required Parameters | |
---|---|
Base Value | The base value to use. |
Modulus Value | The modulus to use to calculate the modulo of the base value. |
To return the value of one number modulo another number:
Use the [Math_Mod] tag. The following examples calculates the value of 375 modulo 60, resulting in 15.
[Math_Mod: 375, 60]
15