名称:- (minus)
例子:
int c = 50 - 5; // Sets 'c' to 45 int d = c - 5; // Sets 'd' to 40 int e = d - 60; // Sets 'e' to -20
int a = 5; // Sets 'a' to 5 int b = -a; // Sets 'b' to -5 int c = -(5 + 3); // Sets 'c' to -8
描述:
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.
从一个值减去另一个值,也可以用于否定一个值。 作为减法运算符,从第一个参数中减去第二个参数的值。 例如,5 – 3产生数字2。作为否定运算符,相当于将数乘以-1。 例如,-5与5 * -1相同。
语法:
-value1
value1 – value2
参数:
|
相关:
— (decrement)
-= (subtract assign)
+ (add)
- 本文固定链接: http://iprocessing.cn/2017/07/21/minus-减/
- 转载请注明: Hewes 于 Processing编程艺术 发表
Pingback 引用通告: — (decrement) | Processing编程艺术