(/ 4 3) returns 4/3 as an answer. What is the simplest way to get 1.3...?
+9
A:
An easy way would be to make sure that one of the numbers in the calculation is already a floating-point number:
> (/ 4.0 3)
1.3333333333333333
Another way would be to use exact->inexact
:
> (exact->inexact (/ 4 3))
1.3333333333333333
Kyle Cronin
2009-06-22 03:44:11
That's it, exact->inexact. The first isn't really an option because the number is a result of several procedures. Thanks!
Harvey
2009-06-22 11:48:24