abs
该方法返回指定数字的绝对值。
语法 (Syntax)
abs(X)
参数 (Parameters)
X - 为绝对值函数指定值。
返回值 (Return Value)
返回值是数字的绝对值。
例如 (For example)
-module(helloworld).
-export([start/0]).
start() ->
Aabs = abs(-3.14),
io:fwrite("~p~n",[Aabs]).
输出 (Output)
当我们运行上述程序时,我们将得到以下结果。
3.14