abs():計算絕對值
pow(x,y):x的y次方
round():採用演算法則Bankers Rounding的觀念,位數左邊是奇數則四捨五入,偶數則五捨六入
round(x,n):處理小數時,第二個參數(n)代表取到小數第幾位,小數位數的下一個小數位數採5以下捨去,51以上進位
x = -10
print(abs(x))
x2 = 5
y = 2
print(pow(x2,y))
x3 = 20.5
print(round(x3))
x4 = 21.5
print(round(x4))
x5 = 2.15
print(round(x5,1))
x6 = 2.25
print(round(x6,1))
x7 = 2.151
print(round(x7,1))
x8 = 2.251
print(round(x8,1))