Hi, Am 22.08.2009 um 16:59 schrieb Jarkko Oranen:
You *really* shouldn't do nested defns. They're misleading, as defns *always* cause a global change. Just use separate functions.
+1
Hm, I wonder if there's a way to avoid calling java. But if you do, I think you should use the form (.divide num x0new digits round-mode) instead of . directly. It's lispier and easier to read.
I would expect +, / and friends to work suffciently smart. However I don't know about the additional arguments.
Though I think setting the math context would be a better solution. eg. (binding [*math-context* (java.math.MathContext. 5 java.math.RoundingMode/ HALF_UP)] (* 5M 1.1111105M)) gives 5.5556M
Have look at with-precision. Sincerely Meikel
smime.p7s
Description: S/MIME cryptographic signature