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

float?

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

如果数字是浮点数,则返回true。

语法 (Syntax)

以下是语法。

(float? number)

例子 (Example)

以下是浮动测试功能的示例。

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

输出 (Output)

上述程序产生以下输出。

false
true