MarcoGervasoni / gwt-math

Automatically exported from code.google.com/p/gwt-math
0 stars 0 forks source link

new BigDecimal(Biginteger val, int scale) #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Why this can't be implemented?

Wouldn't it be something like this ??? :\

         public BigDecimal(BigInteger val) {
                this( "" + val );
         }

         public BigDecimal(BigInteger unscaledVal, int scale) {
                this( "" + val );
                setScale(scale);

         }

Original issue reported on code.google.com by eng.l...@gmail.com on 3 Sep 2009 at 5:45

GoogleCodeExporter commented 9 years ago
I'm having the same issue, anyway the above code does not work, as setScale 
does not
do the job, but something like implementing "movePointLeft" will fix the 
problem.
anyway why none of "point moving" methods are not implemented? is there a 
problem in
there?

Original comment by m.har...@gmail.com on 12 Apr 2010 at 11:44

GoogleCodeExporter commented 9 years ago
Just looked at the sources, and saw that it is already 
implemented(implementation
didn't feel right but anyway). So please update the first page and add those 
methods
to the "emulated" methods list. Thanks for the good job!

Original comment by m.har...@gmail.com on 12 Apr 2010 at 12:33

GoogleCodeExporter commented 9 years ago
The problem that it didn't feel right: it was implemented in r185 using 
setScale, but
setScale does not change the current contents(ie by dividing or moving the 
decimal
point), so the implementation is not right.

Original comment by m.har...@gmail.com on 13 Apr 2010 at 9:29

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/gwt-java-math supports new BigDecimal(Biginteger val, 
int scale)

Original comment by rich...@zschech.net on 27 May 2010 at 2:36