/[classpath]/classpath/java/math/BigDecimal.java
ViewVC logotype

Diff of /classpath/java/math/BigDecimal.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by cbj, Sun Feb 2 00:00:50 2003 UTC revision 1.13 by mark, Fri Feb 14 18:54:57 2003 UTC
# Line 189  public class BigDecimal extends Number i Line 189  public class BigDecimal extends Number i
189            {            {
190              int exp = Integer.parseInt (num.substring (point));              int exp = Integer.parseInt (num.substring (point));
191              exp -= scale;              exp -= scale;
192              if (exp > 0)              if (signum () == 0)
193                  scale = 0;
194                else if (exp > 0)
195                {                {
196                  intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp));                  intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp));
197                  scale = 0;                  scale = 0;
# Line 266  public class BigDecimal extends Number i Line 268  public class BigDecimal extends Number i
268        throw new ArithmeticException ("scale is negative: " + newScale);        throw new ArithmeticException ("scale is negative: " + newScale);
269    
270      if (intVal.signum () == 0)  // handle special case of 0.0/0.0      if (intVal.signum () == 0)  // handle special case of 0.0/0.0
271        return ZERO;        return newScale == 0 ? ZERO : new BigDecimal (ZERO.intVal, newScale);
272            
273      // Ensure that pow gets a non-negative value.      // Ensure that pow gets a non-negative value.
274      int valScale = val.scale;      int valScale = val.scale;

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26