Clojure-float

提供:Dev Guides
移動先:案内検索

Clojure-float?

数値がfloatの場合、trueを返します。

構文

構文は次のとおりです。

(float? number)

以下は、フロートテスト関数の例です。

(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