Difference between revisions of "Documentation/How Tos/Calc: MOD function"
From Apache OpenOffice Wiki
< Documentation | How Tos
(Initial content) |
m |
||
Line 3: | Line 3: | ||
== MOD == | == MOD == | ||
Returns the remainder when one integer is divided by another. | Returns the remainder when one integer is divided by another. | ||
− | |||
=== Syntax: === | === Syntax: === | ||
Line 10: | Line 9: | ||
: This function is implemented as <tt>'''number - divisor * INT( number/divisor)'''</tt> , and this formula gives the result if the arguments are not integer. | : This function is implemented as <tt>'''number - divisor * INT( number/divisor)'''</tt> , and this formula gives the result if the arguments are not integer. | ||
− | |||
=== Example: === | === Example: === | ||
Line 18: | Line 16: | ||
<tt>'''MOD(11.25; 2.5)'''</tt> | <tt>'''MOD(11.25; 2.5)'''</tt> | ||
: returns <tt>'''1.25'''</tt>. | : returns <tt>'''1.25'''</tt>. | ||
− | |||
=== See also: === | === See also: === |
Revision as of 06:29, 2 March 2008
MOD
Returns the remainder when one integer is divided by another.
Syntax:
MOD(number; divisor)
- For integer arguments this function returns number modulo divisor, that is the remainder when number is divided by divisor.
- This function is implemented as number - divisor * INT( number/divisor) , and this formula gives the result if the arguments are not integer.
Example:
MOD(22; 3)
- returns 1, the remainder when 22 is divided by 3.
MOD(11.25; 2.5)
- returns 1.25.