算術 - Amazon QuickSight

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

算術

下表顯示可與 JSON 表達式語言搭配使用的算術表達式。

作業 表達式 輸入 輸出
加法 ["+", operand1, operand2] { sum: ["+", 2, 4] } { sum: 6 }
減法 ["-", operand1, operand2] { difference: ["-", 10, 3] } { difference: 7 }
乘法 ["*", operand1, operand2] { product: ["*", 5, 6] } { product: 30 }
除法 ["/", operand1, operand2] { quotient: ["/", 20, 4] } { quotient: 5 }
Modulo ["%", operand1, operand2] { remainder: ["%", 15, 4] } { remainder: 3 }
指數化 ["**", base, exponent] { power: ["**", 2, 3] } { power: 8 }
絕對值 ["abs", operand] { absolute: ["abs", -5] } { absolute: 5 }
Square Root (平方根) ["sqrt", operand] { sqroot: ["sqrt", 16] } { sqroot: 4 }
Logarithm (以 10 為底) ["log10", operand] { log: ["log10", 100] } { log: 2 }
自然對數 ["ln", operand] { ln: ["ln", Math.E] } { ln: 1 }
圓形 ["round", operand] { rounded: ["round", 3.7] } { rounded: 4 }
樓層 ["floor", operand] { floor: ["floor", 3.7] } { floor: 3 }
天花板 ["ceil", operand] { ceiling: ["ceil", 3.2] } { ceiling: 4 }
正弦波 ["sin", operand] { sine: ["sin", 0] } { sine: 0 }
餘弦 ["cos", operand] { cosine: ["cos", 0] } { cosine: 1 }
切線 ["tan", operand] { tangent: ["tan", Math.PI] } { tangent: 0 }