Mod: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (1 revision)
 
mNo edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''Mod''' [[internal function]] returns the remainder of the numerator divided by the denominator. In other words, it is the remainder left after the division of one integer by another


The '''Mod''' [[internal function]] returns the remainder of the numerator divided by the denominator.
MOD(<numerator>, <denominator>)


Mod( numerator, denominator )
====Comments and Examples====


====Comments and Examples====
For example, 7 divided by 3 equals 2 with a remainder of 1. Consider the following code snippet:
  7 divided by 3 equals 2 with a remainder of 1
 
  MOD(7,3)=1
00010 print MOD(7,3)
  MOD(6,3)=0
00020 print MOD(6,3)
  MOD(5,3)=2
00030 print MOD(5,3)
 
Output:
 
1
0
2


See also [[Rem (Internal Function)]].
See also [[Rem (Internal Function)]].

Latest revision as of 17:35, 22 May 2014

The Mod internal function returns the remainder of the numerator divided by the denominator. In other words, it is the remainder left after the division of one integer by another

MOD(<numerator>, <denominator>)

Comments and Examples

For example, 7 divided by 3 equals 2 with a remainder of 1. Consider the following code snippet:

00010 print MOD(7,3)
00020 print MOD(6,3)
00030 print MOD(5,3)

Output:

1
0
2

See also Rem (Internal Function).