Difference between revisions of "Manuals/calci/MOD"
Jump to navigation
Jump to search
(Created page with "<div id="16SpaceContent" align="left"><div class="ZEditBox" align="justify"> Syntax </div></div> ---- <div id="4SpaceContent" align="left"><div class="ZEditBox" align=...") |
|||
(15 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | <div | + | <div style="font-size:30px">'''MOD(Number,Divisor) '''</div><br/> |
+ | *<math>Number</math> and <math>Divisor</math> are any real numbers. | ||
+ | **MOD() returns the remainder from division. | ||
− | + | ==Description== | |
+ | *This function gives the remainder of the number after dividing with some number. | ||
+ | *When we divide two integers we will get the result like this: <math>\frac{X}{Y}= Q</math> with remainder <math>R</math>. Here <math> X </math> is the dividend, <math>Y</math> is the divisor, <math>Q</math> is the Quotient and <math> R</math> is the remainder.So <math> MOD(n,d)=R</math>. | ||
+ | *For e.g., MOD(5,2)=1. Here 1 is the remainder. | ||
+ | *Ler number be "n" and the divisor be "d" | ||
+ | *The <math>MOD</math> function we can write using <math>INT</math> function: <math> MOD(n,d)=n-d*INT(n/d)</math>. | ||
+ | *This function will return the result as error when the <math>d</math> value is 0. | ||
+ | *Suppose the value of <math>n</math> and <math>d</math> with same sign either '+' or '-',then the result also with same sign. | ||
+ | *But <math>n</math> and <math>d</math> are with different then the result will come with the <math> d </math> sign only. | ||
− | </ | + | ==ZOS== |
− | + | *The syntax is to calculate remainder of the given numbers in ZOS is <math>MOD(Number,Divisor)</math>. | |
− | < | + | **<math>Number</math> and <math>Divisor</math> are any real numbers. |
+ | *For e.g.,mod(10,2),mod(50.2,-4) | ||
− | + | ==Examples== | |
+ | #=MOD(5,2)=1 | ||
+ | #=MOD(-11,-3)=-2 | ||
+ | #=MOD(25,5)=0 | ||
+ | #=MOD(12,-4)=0 | ||
+ | #=MOD(85,-9)=-5 | ||
+ | #=MOD(-52,7)=4 | ||
+ | #=MOD(0,9)=0 | ||
+ | #=MOD(9,0)=#N/A (DIVISOR == 0) | ||
+ | #=MOD(5.5,2)=1.5 | ||
− | + | ==Related Videos== | |
− | |||
− | |||
− | + | {{#ev:youtube|io-EZ8VS0MY|280|center|MOD}} | |
− | + | ==See Also== | |
− | + | *[[Manuals/calci/INT | INT ]] | |
− | + | *[[Manuals/calci/ROUND | ROUND ]] | |
− | |||
− | |||
− | + | ==References== | |
+ | [http://en.wikipedia.org/wiki/Modulo_operation Mod] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | *[[Z_API_Functions | List of Main Z Functions]] | |
− | + | *[[ Z3 | Z3 home ]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 03:18, 9 June 2020
MOD(Number,Divisor)
- and are any real numbers.
- MOD() returns the remainder from division.
Description
- This function gives the remainder of the number after dividing with some number.
- When we divide two integers we will get the result like this: with remainder . Here is the dividend, is the divisor, is the Quotient and is the remainder.So .
- For e.g., MOD(5,2)=1. Here 1 is the remainder.
- Ler number be "n" and the divisor be "d"
- The function we can write using function: .
- This function will return the result as error when the value is 0.
- Suppose the value of and with same sign either '+' or '-',then the result also with same sign.
- But and are with different then the result will come with the sign only.
ZOS
- The syntax is to calculate remainder of the given numbers in ZOS is .
- and are any real numbers.
- For e.g.,mod(10,2),mod(50.2,-4)
Examples
- =MOD(5,2)=1
- =MOD(-11,-3)=-2
- =MOD(25,5)=0
- =MOD(12,-4)=0
- =MOD(85,-9)=-5
- =MOD(-52,7)=4
- =MOD(0,9)=0
- =MOD(9,0)=#N/A (DIVISOR == 0)
- =MOD(5.5,2)=1.5
Related Videos
See Also
References