Difference between revisions of "Manuals/calci/UNITMOD"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div style="font-size:30px">'''UNITMOD(A,B) '''</div><br/> *<math>A</math> and <math>B</math> are any real numbers. ==Description== *This function gives the remainder of the ...")
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div style="font-size:30px">'''UNITMOD(A,B) '''</div><br/>
+
<div style="font-size:30px">'''UNITMOD(a,b) '''</div><br/>
*<math>A</math> and <math>B</math> are any real numbers.
+
*<math>a</math> and <math>b</math> are any real numbers.
  
 
==Description==
 
==Description==
 
*This function gives the remainder of the number after dividing with some number.
 
*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{A}{B}= Q</math> with remainder <math>R</math>. Here <math>A</math> is the dividend, <math>B</math> is the divisor, <math>Q</math> is the Quotient and <math> R</math> is the remainder.So <math> UNITMOD(A,B)=R</math>.  
+
*When we divide two integers we will get the result like this:  <math>\frac{a}{b}= q</math> with remainder <math>r</math>. Here <math>a</math> is the dividend, <math>b</math> is the divisor, <math>q</math> is the Quotient and <math> r</math> is the remainder.So <math> UNITMOD(a,b)=r</math>.  
 
*For e.g., UNITMOD(5,2)=1. Here 1 is the remainder.
 
*For e.g., UNITMOD(5,2)=1. Here 1 is the remainder.
*Let number be "A" and the divisor be "B"
+
*This function gives an error when <math>b</math> value is 0.
*The <math>UNITMOD</math> function we can write using <math>INT</math> function: <math> UNITMOD(A,B)=A-B*INT(A/d)</math>.
+
*<math>a</math> and <math>b</math> can be positive or negative. Suppose <math>a</math> and <math>b</math> are of same sign either '+' or '-',then the resultant sign is also the same.  
*This function will return the result as error when the <math>d</math> value is 0.
+
*But <math>a</math> and <math>b</math> are with different sign, then the result will come with the sign of <math>a</math>.
*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==
 
==ZOS==
*The syntax is to calculate remainder of the given numbers in ZOS is <math>UNITMOD(A,B)</math>.
+
*The syntax is to calculate remainder of the given numbers in ZOS is <math>UNITMOD(a,b)</math>.
**<math>A</math> and <math>B</math> are any real numbers.
+
**<math>a</math> and <math>b</math> are any real numbers.
 
*For e.g.,UNITMOD(10,2),UNITMOD(50.2,-4)
 
*For e.g.,UNITMOD(10,2),UNITMOD(50.2,-4)
  
Line 22: Line 20:
 
#=UNITMOD(25,5)=0
 
#=UNITMOD(25,5)=0
 
#=UNITMOD(12,-4)=0
 
#=UNITMOD(12,-4)=0
#=UNITMOD(85,-9)=-5
+
#=UNITMOD(85,-9)=4
#=UNITMOD(-52,7)=4
+
#=UNITMOD(-52,7)=-3
 
#=UNITMOD(0,9)=0
 
#=UNITMOD(0,9)=0
#=UNITMOD(9,0)=NAN
+
#=UNITMOD(9,0)=null
 
#=UNITMOD(5.5,2)=1.5
 
#=UNITMOD(5.5,2)=1.5
  

Latest revision as of 02:20, 11 June 2020

UNITMOD(a,b)


  • and are any real numbers.

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., UNITMOD(5,2)=1. Here 1 is the remainder.
  • This function gives an error when value is 0.
  • and can be positive or negative. Suppose and are of same sign either '+' or '-',then the resultant sign is also the same.
  • But and are with different sign, then the result will come with the sign of .

ZOS

  • The syntax is to calculate remainder of the given numbers in ZOS is .
    • and are any real numbers.
  • For e.g.,UNITMOD(10,2),UNITMOD(50.2,-4)

Examples

  1. =UNITMOD(5,2)=1
  2. =UNITMOD(-11,-3)=-2
  3. =UNITMOD(25,5)=0
  4. =UNITMOD(12,-4)=0
  5. =UNITMOD(85,-9)=4
  6. =UNITMOD(-52,7)=-3
  7. =UNITMOD(0,9)=0
  8. =UNITMOD(9,0)=null
  9. =UNITMOD(5.5,2)=1.5

Related Videos

MOD

See Also


References

Mod