From Clomosy Docs
No edit summary |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> | |||
keyword Mod | |||
</div> | |||
The mod keyword returns the remainder of the division of two numbers. The integer result of the division is ignored.<br> | The mod keyword returns the remainder of the division of two numbers. The integer result of the division is ignored.<br> | ||
<b>Example</b><br> | |||
In the example, it will return the remainder of dividing 20 by 12. So as a result you will see the value 8 on the screen.<br> | |||
''' | <pre> | ||
var | |||
dividingNumber,divisor,remainder : Integer; | |||
{ | |||
dividingNumber = 20; | |||
divisor = 12; | |||
remainder = dividingNumber Mod divisor; | |||
ShowMessage(IntToStr(dividingNumber)+' Mod '+IntToStr(divisor)+' :'+IntToStr(remainder)); | |||
} | |||
</pre> | |||
<b>Output:</b><br> | |||
<div class="alert alert-success" role="alert" data-bs-theme="light"> | |||
20 Mod 12 : 8 | |||
</div> | |||
<h2> See Also </h2> | |||
* [[System_Library#Math_Functions | Math Functions]] | |||
{{#seo:|title=Mod Overview in Clomosy - Clomosy Docs}} | |||
{{#seo:|description=Explore the Mod operator in Clomosy. Simplify arithmetic tasks with efficient remainder operations to enhance your app’s functionality.}} | |||
Latest revision as of 13:01, 24 December 2024
keyword Mod
The mod keyword returns the remainder of the division of two numbers. The integer result of the division is ignored.
Example
In the example, it will return the remainder of dividing 20 by 12. So as a result you will see the value 8 on the screen.
var
dividingNumber,divisor,remainder : Integer;
{
dividingNumber = 20;
divisor = 12;
remainder = dividingNumber Mod divisor;
ShowMessage(IntToStr(dividingNumber)+' Mod '+IntToStr(divisor)+' :'+IntToStr(remainder));
}
Output:
20 Mod 12 : 8