Re: Problems With BigDecimal Precision

2012-07-03 Thread Eric Scrivner
Thank you for your response, exactly what I was looking for. I knew I was missing something. On Monday, July 2, 2012 5:55:49 AM UTC-7, Pierre-Henry Perret wrote: > > Hi Eric, > > The fundamental reason on that behaviour , is that Java Math library which > takes *double *as args, truncates its ar

Re: Problems With BigDecimal Precision

2012-07-02 Thread Pierre-Henry Perret
Hi Eric, The fundamental reason on that behaviour , is that Java Math library which takes *double *as args, truncates its arguments, which is the case with *Math.pow .* >From *The Joy of Clojure, sec. 4.1.1:* __ (let [imadeuapi 3.141592653589793238462643

Re: Problems With BigDecimal Precision

2012-07-02 Thread Pierre-Henry Perret
Hi Eric, I tried to see what was going on with this calculation, knowing that when working with Java libraries which takes primitive type (as it is the cas with Math.pow) this can be easily corrupted, which is the case in the * probability-collision* fn So , I think that Java lib cant be used.

Problems With BigDecimal Precision

2012-07-01 Thread Eric Scrivner
Hey All, This is more than likely a newbie question, so my apologies if this is not directly clojure related. I'm not sure if this is a Java or Clojure specific issue, my guess is both. I'm trying to do some probability calculations with both very large and very small numbers. The function I'm