跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

abs Function ​

abs returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it.

Examples ​

shellsession
> abs(23)
23
> abs(0)
0
> abs(-12.4)
12.4

基于 MPL-2.0 许可证发布。