Clojure - float?



如果該數字是小數,則返回 true。

語法

以下是語法。

(float? number)

示例

以下是 float 測試函式的一個示例。

(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)

輸出

以上程式產生以下輸出。

false
true
clojure_numbers.htm
廣告
© . All rights reserved.