Performs the modulo operation on numbers.
Namespace: MSBuild.Community.Tasks.Math
Assembly: MSBuild.Community.Tasks (in MSBuild.Community.Tasks.dll)
Syntax
Example
Numbers evenly divide:
Copy Code | |
---|---|
<Math.Modulo Numbers="12;4"> <Output TaskParameter="Result" PropertyName="Result" /> </Math.Modulo> <Message Text="12 modulo 4 = $(Result)"/> |
Copy Code | |
---|---|
12 modulo 4 = 0 |
Copy Code | |
---|---|
<Math.Modulo Numbers="14;4"> <Output TaskParameter="Result" PropertyName="Result" /> </Math.Modulo> <Message Text="14 modulo 4 = $(Result)"/> |
Copy Code | |
---|---|
14 modulo 4 = 2 |
Copy Code | |
---|---|
<Math.Modulo Numbers="12;3.5"> <Output TaskParameter="Result" PropertyName="Result" /> </Math.Modulo> <Message Text="12 modulo 3.5 = $(Result)"/> |
Copy Code | |
---|---|
12 modulo 3.5 = 1.5 |
Remarks
The modulo operation finds the remainder of the division of one number by another.
When the second number (modulus) is a fractional value, the result can be a fractional value.
Equivalent to the % operator in C# or the Mod operator in Visual Basic.
Inheritance Hierarchy
System.Object
Microsoft.Build.Utilities.Task
MSBuild.Community.Tasks.Math.MathBase
MSBuild.Community.Tasks.Math.Modulo
Microsoft.Build.Utilities.Task
MSBuild.Community.Tasks.Math.MathBase
MSBuild.Community.Tasks.Math.Modulo
Thread Safety
Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
See Also
Documentation version 1.0.0.0.