Erlang - cos 方法
此方法返回指定值的余弦。
语法
cos(X)
参数
X - 为余弦函数指定一个值。
返回值
返回值是表示余弦值的浮点值。
例如
-module(helloworld).
-import(math,[cos/1]).
-export([start/0]).
start() ->
Cosin = cos(45),
io:fwrite("~p~n",[Cosin]).
输出
当我们运行上面的程序时,我们将得到以下结果。
0.5253219888177297