Name

% (modulo)

Examples
a = 5 % 4          # Sets 'a' to 1
b = 125 % 100      # Sets 'b' to 25
c = 285.5 % 140.0  # Sets 'c' to 5.5
d = 30.0 % 33.0    # Sets 'd' to 30.0
#Keep line within sketch boundaries
a = 0
def draw():
    background(200)
    global a
    a = (a + 1) % width  # 'a' increases between 0 and width
    line(a, 0, a, height)
Description
Syntax
value1 % value2
Parameters
value1
value2
Related / (divide)
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License