|
Hi
I have written a sample test program:
.........
public static void main (String
args[])
{ Double op1 = new Double(12.0), op2 = new Double(1E-9), res = new Double ( op1.doubleValue()*op2.doubleValue() ); System.out.println("op1: " + op1); System.out.println("op2: " + op2); System.out.println("res: " + res); } The output is:
op1: 12.0000000001
op2: 1.0E-9 res: 1.2000000000100001E-8 What the @!# is going on?
How can I fix this?
Any help appreciated.
Thanks
Ivan
To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm
|
- [jdjlist] Re: Double multiplication Ivan Bradac
- [jdjlist] Re: Double multiplication Ivan Bradac
- [jdjlist] Re: Double multiplication James A. N. Stauffer
- [jdjlist] Oracle First Steps/ WebSphere Saikat Goswami
- [jdjlist] Re: Oracle First Steps/ We... David Gallardo
- [jdjlist] Re: Double multiplication Paul Franz
- [jdjlist] Re: Double multiplication Ivan Bradac
