Processing, - (minus)
用法介紹。
用法
-value1
value1 - value2
參數
value1
int 或浮點數value2
int 或浮點數
說明
從另一個值中減去一個值,也可以用於否定一個值。作為減法運算符,從第一個參數中減去第二個參數的值。例如,5 - 3 產生數字 2。作為否定運算符,它相當於將一個數字乘以 -1。例如,-5 與 5 * -1 相同。
例子
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
相關用法
- Processing -- (decrement)用法及代碼示例
- Processing -= (subtract assign)用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
- Processing join()用法及代碼示例
- Processing () (parentheses)用法及代碼示例
- Processing Pulse用法及代碼示例
- Processing PShader用法及代碼示例
- Processing PVector.set()用法及代碼示例
- Processing FloatDict.sortKeysReverse()用法及代碼示例
- Processing texture()用法及代碼示例
- Processing IntDict.add()用法及代碼示例
- Processing PShape.enableStyle()用法及代碼示例
- Processing FloatDict.sub()用法及代碼示例
- Processing String用法及代碼示例
- Processing PImage.pixels[]用法及代碼示例
- Processing vertex()用法及代碼示例
- Processing PVector.mag()用法及代碼示例
- Processing thread()用法及代碼示例
- Processing Capture.stop()用法及代碼示例
- Processing Env.play()用法及代碼示例
- Processing StringList用法及代碼示例
- Processing parseJSONArray()用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 - (minus)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。