Changes

Created page with "<div style="font-size:30px">'''REMAINDER(number,divisor) '''</div><br/> *<math>number</math> is a single number or set of numbers, and *<math>divisor</math> is any real number..."
<div style="font-size:30px">'''REMAINDER(number,divisor) '''</div><br/>
*<math>number</math> is a single number or set of numbers, and
*<math>divisor</math> is any real number.

==Description==
*This function gives the remainder of the number after dividing with given number. This is similar to function <math>MOD()</math>
*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> REMAINDER(X,Y)=R</math>.
*This function will return the result as error when the <math>Y</math> value is 0.
*Suppose the value of <math>X</math> and <math>Y</math> with same sign either '+' or '-',then the result is also displayed with the same sign.
*But if <math>X</math> and <math>Y</math> are with different signs,one positive and other negative, then the result will have <math>Y</math> sign only.

==ZOS==
*The syntax is to calculate remainder of the given numbers in ZOS is <math>REMAINDER(number,divisor)</math>.
**<math>number</math> and <math>divisor</math> are any real numbers.
*For e.g.,REMAINDER(10,2),REMAINDER(50.2,-4)

==Examples==
#=REMAINDER(7,2)=1
#=REMAINDER(-11,-3)=-2
#=REMAINDER(75,5)=0
#=REMAINDER(12,-4)=0
#=REMAINDER(85,-9)=-5
#=REMAINDER(-52,7)=4
#=REMAINDER(0,9)=0
#=REMAINDER(9,0)=NAN
#=REMAINDER(5.5,2)=1.5

For an array of numbers/dividends, a table with remainder values is displayed as follows -
*REMAINDER(11..15,4)
{| class="wikitable"
|-
!Number !!Divisor!!MOD
|-
| 11 || 4 || 3
|-
| 12 || 4 || 0
|-
| 13 || 4 || 1
|-
| 14 || 4 || 2
|-
| 15 || 4 || 3
|}



*REMAINDER([66,34,21],8)
{| class="wikitable"
|-
!Number !!Divisor!!MOD
|-
| 66 || 8 || 2
|-
| 34 || 8 || 2
|-
| 21 || 8 || 5
|}

==Related Videos==

{{#ev:youtube|BIGX05Mp5nw|280|center|Remainder}}

==See Also==
*[[Manuals/calci/MOD | MOD ]]
*[[Manuals/calci/INT | INT ]]
*[[Manuals/calci/ROUND | ROUND ]]

==References==
[https://en.wikipedia.org/wiki/Remainder Remainder]



*[[Z_API_Functions | List of Main Z Functions]]

*[[ Z3 | Z3 home ]]
writer
2,661

edits