计算一个数的绝对值。
一个数的绝对值是它在数轴上距离零的距离。-5 和 5 都距离零五个单位,所以调用 abs(-5) 和 abs(5) 都会返回 5。一个数的绝对值始终是正数。
示例
语法
abs(n)
参数
n
数字:
要计算的数值。
返回值
数字: 给定数的绝对值。
This page is generated from the comments in src/math/calculation.js . Please feel free to edit it and submit a pull request!