当前位置: 首页 > 文档资料 > Erlang 中文教程 >

Is_Integer

优质
小牛编辑
117浏览
2023-12-01

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

语法 (Syntax)

Is_Integer(X)

参数 (Parameters)

X - 数值。

返回值 (Return Value)

如果指定为参数的数字是Integer值,则返回值为true,否则返回false。

例如 (For example)

-module(helloworld). 
-export([start/0]). 
start() ->
   Num = 3, 
   io:fwrite("~w",[is_integer(Num)]).

输出 (Output)

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

true