user=> (rational? 1) true user=> (rational? 1.0) false user=> (class 1.0) java.lang.Double ;; Note that decimal? only returns true if n is a BigDecimal.
(defn rational?
"Returns true if n is a rational number"
{:added "1.0"
:static true}
[n]
(or (integer? n) (ratio? n) (decimal? n)))
Comments top
No comments for rational?. Log in to add a comment.