On Nov 16, 2009, at 5:56 AM, prhlava wrote: > No big deal, the fix is simple - this is heads up if more people find > their code broke with over-flow to infinity with the new version of > clojure. > > It looks that float type "propagates" into arithmetics (and it did not > before) - better explanation welcome.
I think your analysis is likely correct. Certainly Math/floor does return a
Double and Clojure's number handling has evolved over time.
As an alternative to the code you posted, for positive integers n and m,
(int (Math/floor (/ n m))
is equivalent to
(quot n m)
If negative values are possible, you could write a function based on quot that
would give the appropriate answer in all cases.
--Steve
smime.p7s
Description: S/MIME cryptographic signature
