算術運算子是用來組合數字、數值變數、數值欄位及數值函式,藉此取得另一個數字。
算術運算子包括加法 (+)、減法 (-)、乘法 (*)、除法 (/)、整數除法 (\)、百分比 (%)、Modulus (Mod)、負數 (-) 及指數 (^)。
範例
//Outstanding preferred stock as a percent of //common stock {Financials.Preferred Stock} % {Financials.Common Stock}; //The square root of 9, Sqr(9) is 3 //The formula returns 17 7 + 2 * 3 - 2 + Sqr(6 + 3) * Length("up");
大致而言,程式是以下列的順序來驗算運算式:
範例
先從左至右執行乘法和除法。然後再執行加法和減法。例如,5 + 10 * 3 = 5 + 30 = 35。
可以用括號來變更優先順序;例如,(5 + 10) * 3 = 15 * 3 = 45.如果您不確定執行的順序,最好用括號來清楚地表達您的意思。