Problems with BigDecimal

Sergey Voitseh svoitseh at cms.vinnica.ua
Tue Jan 30 06:57:53 PST 2001



     I've modify my test class now it is

import java.math.*;
import java.io.IOException;

public class Test
{
     public static void main (String[] args)
     {
          BigDecimal bd1=new BigDecimal(new BigInteger("123"),1);
          System.out.println("bd befor = "+bd1.toString());
          bd1=bd1.add(new BigDecimal("10"));
          System.out.println("bd+10 = "+bd1.toString());
          bd1=bd1.multiply(new BigDecimal((double)10));
          System.out.println("bd*10 = "+bd1.toString());
          bd1=bd1.subtract(new BigDecimal((double)11));
          System.out.println("bd-11 = "+bd1.toString());
          bd1=bd1.divide(new BigDecimal((double)10),4);
          System.out.println("bd/10 = "+bd1.toString());
     }
}

and it works both kaffe and jdk.
     Sergey



More information about the kaffe mailing list