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

integer?

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

如果数字是整数,则返回true。

语法 (Syntax)

以下是语法。

(integer? number)

例子 (Example)

以下是整数测试函数的示例。

(ns clojure.examples.hello
   (:gen-class))
;; This program displays Hello World
(defn Example []
   (def x (integer? 0))
   (println x)
   (def x (integer? 0.0))
   (println x))
(Example)

输出 (Output)

上述程序产生以下输出。

true
false