abs()

入力の絶対値を計算します。

構文

abs(x)

構文規則について詳しく知る。

パラメーター

名前 必須 説明
x int、real、または timespan ✔️ 絶対にする値。

戻り値

x の絶対値。

print abs(-5)

出力

print_0
5