Files
processing4/web/reference/API/modulo.xml
2005-01-27 06:48:42 +00:00

71 lines
1.1 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>% (modulo)</name>
<category>Math</category>
<subcategory>Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 20%100; // Sets a to 20
int b = 20%100; // Sets b to 20
int c = 75%100; // Sets c to 75
int d = 275%100; // Sets d to 75
</code>
</example>
<example>
<image></image>
<code>
float a = 0.0;
void loop() {
background(204);
a = (a + 0.5)%width;
line(a, 0, a, height);
}
</code>
</example>
<description>
Calculates the remainer when one number is divided by another. It is extremely useful for keeping numbers within a boundary such as keeping a shape on the screen.
</description>
<syntax>
<c>value1</c>%<c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int</description>
</parameter>
<parameter>
<label>value2</label>
<description>int</description>
</parameter>
<returns></returns>
<related>
/ (divide)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>