无涯教程-Erlang - Is_float函数

76 阅读1分钟

该方法检查数字是否为浮点值。

Is_float - 语法

Is_float(X)

X  -  一个数字值。

Is_float - 返回值

如果指定为参数的数字为浮点型,则返回值为true,否则返回false。

-module(helloLearnfk). 
-export([start/0]). 

start() -> Num=3.00, io:fwrite("~w",[is_float(Num)]).

当我们运行上述程序时,我们将得到以下输出。

true

参考链接

www.learnfk.com/erlang/erla…