When i do (/ 411 125) , i dont get it in terms of decimal, how do I do that?
views:
418answers:
3
+3
A:
As documented, integer division yields rational numbers. Try
(/ 411.0 125)
Jonathan Feinberg
2009-10-20 18:36:09
+3
A:
If you use a float for the dividend, you'll get a decimal answer.
(/ 22.0 7) -> 3.142857142857143
There's also the (unchecked-remainder x y) function available.
ire_and_curses
2009-10-20 18:38:53
+7
A:
user> (float (/ 411 125))
3.288
user> (double (/ 411 125))
3.288
Brian Carper
2009-10-20 18:42:03