user=> (rationalize 1.5) 3/2
user=> (rationalize Math/PI) 3141592653589793/1000000000000000 user=> (rationalize (Math/sqrt 2)) 14142135623730951/10000000000000000
(defn rationalize "returns the rational value of num" {:added "1.0" :static true} [num] (. clojure.lang.Numbers (rationalize num)))
Comments top
No comments for rationalize. Log in to add a comment.