Problems with BigDecimal
Sergey Voitseh
svoitseh at cms.vinnica.ua
Tue Jan 30 05:00:55 PST 2001
Hi All.
I wrote a simple test class which uses BigDecimal.class but it didn't work
properly under kaffe but worked properly with jdk. My test class is following:
import java.math.*;
import java.io.IOException;
public class Test
{
public static void main (String[] args)
{
BigDecimal bd1=new BigDecimal((double)0);
System.out.println("bd befor = "+bd1.toString());
bd1=bd1.add(new BigDecimal((double)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),0);
System.out.println("bd/10 = "+bd1.toString());
}
}
When I run it I don't see any correct result. Has anyone ideas why it
didn't work?
Regards, Sergey
More information about the kaffe
mailing list