Lasso Soft Inc. > Home

[Math_Mod]

[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.

  • Syntax
  • Parameters
[Math_Mod: Base ValueModulus Value]
Required Parameters
Base Value The base value to use.
Modulus Value The modulus to use to calculate the modulo of the base value.
Examples

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]
Result:
15
Tag Link [Math_Mod] Category Math
Type Substitution Data Source Any
Support Preferred Version 3.0
Output Type Integer Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0,LDML3x

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft