數學函式 math-functions
數學函式為歷程運算式中的數值計算提供基本的數學運算。 這些函式可讓您對資料執行精確數值計算和轉換。
當您需要以下作業時使用數學函式:
數學函式會處理十進位和整數型別,並自動管理型別轉換,以確保歷程運算式中的結果準確。
random random
產生介於0和1之間的隨機數字。
語法
random()簽章與傳回的型別
random()
傳回小數。
round round
傳回引數最接近的整數值,並會將四捨五入連結至正無限。
語法
round(<parameters>)參數
- 小數
- 整數
簽章與傳回型別
round(<decimal>)
round(<integer>)
傳回整數。
範例
round(3.14)
傳回3。
round(3.54)
傳回4。
round(-3.14)
傳回–3。
round(3)
傳回3。
recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76