On Fri, Jul 10, 2009 at 7:14 AM, John Harrop<[email protected]> wrote: > It would be useful to have a *math-context* or similar that had a sensible > default and could be set with binding to affect bigdec calculations within > the temporal scope of said binding.
user=> (binding [*math-context* (java.math.MathContext. 5)] (+ 2 1.111111111M)) 3.1111M Even works in 1.0.0! Dunno if it's documented anywhere, though. :-/ In git master (a.k.a. 1.1.0-alpha-SNAPSHOT), you can now also set it at the REPL: user=> (set! *math-context* (java.math.MathContext. 5)) #<MathContext precision=5 roundingMode=HALF_UP> http://www.assembla.com/spaces/clojure/tickets/137 --Chouser --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
