It just appears to be a rounding error because floating point values aren't
exact. Do you see somethng else wrong?
--- Ivan Bradac <[EMAIL PROTECTED]> wrote:
> Sorry, the actual output was:
>
> op1: 12.0
> op2: 1.0E-9
> res: 1.2000000000000002E-8
>
> ----- Original Message -----
> From: Ivan Bradac
> To: JDJList
> Sent: Thursday, September 19, 2002 4:31 PM
> Subject: [jdjlist] Double multiplication
>
>
> 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
>
> To change your JDJList options, please visit:
> http://www.sys-con.com/java/list.cfm
>
=====
James Amos Nathaniel Stauffer
Stauffer_James
@yahoo.com
Spam food: [EMAIL PROTECTED]
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm