Numeric Data

Arithmetic Functions

Function Name Description
acos(x) arc cos
asin(x) arc sin
atan(x) arc tan
cos(x) cos
cot(x) cotangent
exp(x) e^x
ln(x) 自然对数
sin(x) sin
sqrt(x) sqrt
tan(x) tan
mod(x,y) 取y对x的余数
POW(x,y) x^y

Controlling Number Precision

  • FLOOR()
  • CEIL()
  • ROUND()
    • ROUND(num,index)保留到小数点后位, 当index为负数时,保留小数点前
    • ROUND(17.0909,1) return 17.1; ROUND(17.0909,-1) return 20;
  • TRUNCATE() 类似于ROUND() 但并不四舍五入,而是仅保留前面的数
    • TRUNCATE(17.0909, 1) return 17.1; TRUNCATE(17.0909, -1) retrun 10;

Handling Signed Data

  • ABS()
  • SIGN()

results matching ""

    No results matching ""