数値の絶対値を計算します。

数値の絶対値とは、数直線上でその数値と0との距離です。 -5と5はどちらも0から5単位離れているので、abs(-5)abs(5)はどちらも5を返します。数値の絶対値は常に 正の値です。

実例

シンタックス

abs(n)

パラメーター

n
Number:

計算する数値。

リターン

Number: 与えられた数値の絶対値。
This page is generated from the comments in src/math/calculation.js . Please feel free to edit it and submit a pull request!

関連するリファレンス