When I do (/ 411 125)
, I don't get it in terms of decimal. How do I do that?
One of the simplest ways to "round" numbers is truncation. int will do this for you, coercing floating-point numbers to integers by simply chopping off any trailing decimal places.
user> (float (/ 411 125)) 3.288 user> (double (/ 411 125)) 3.288
user=> (clojure-version) "1.4.0" user=> (doc quot) ------------------------- clojure.core/quot ([num div]) quot[ient] of dividing numerator by denominator. nil user=> (quot 411 125) 3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With