mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 01:50:44 +01:00
70 lines
1.2 KiB
XML
70 lines
1.2 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<root>
|
|
<name>- (minus)</name>
|
|
|
|
<category>Math</category>
|
|
|
|
<subcategory>Operators</subcategory>
|
|
|
|
<usage>Web & Application</usage>
|
|
|
|
<example>
|
|
<image></image>
|
|
<code>
|
|
int c = 50 - 5; // Sets c to 45
|
|
int d = c - 5; // Sets d to 40
|
|
int e = d - 60; // Sets e to -20
|
|
</code>
|
|
</example>
|
|
|
|
<example>
|
|
<image></image>
|
|
<code>
|
|
int a = 5; // Sets "a" to 5
|
|
int b = -a; // Sets "b" to -5
|
|
int c = -(5 + 3); // Sets "c" to -8
|
|
</code>
|
|
</example>
|
|
|
|
<description>
|
|
Subtracts one value from another and may also be used to negate a value. As a subtraction operator, the value of the second parameter is subtracted from the first. For example, 5 - 3 yields the number 2. As a negation operator, it is equivalent to multiplying a number by -1. For example, -5 is the same as 5 * -1.
|
|
</description>
|
|
|
|
<syntax>
|
|
-<c>value1</c>
|
|
<c>value1</c> - <c>value2</c>
|
|
</syntax>
|
|
|
|
<parameter>
|
|
<label>value1</label>
|
|
<description>int or float</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>value2</label>
|
|
<description>int or float</description>
|
|
</parameter>
|
|
|
|
<returns></returns>
|
|
|
|
<related>
|
|
-- (decrement)
|
|
-= (subtract assign)
|
|
+ (add)
|
|
</related>
|
|
|
|
<availability>1.0</availability>
|
|
|
|
<type>Operator</type>
|
|
|
|
<partof>PDE</partof>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</root>
|