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
erlang_numbers.htm
廣告
© . All rights reserved.