*Dear all, *

I have an issue, when I use the Math.pow function:

        System.out.println("Error: " + Math.pow(1.2, 3));
// prints 1.7279999999999998
        System.out.println("Correct: " + (1.2*1.2*1.2));
// prints 1.728

There is loss of precision because the correct result is: 1.728. I know
that I can give an approximate, but this is not the matter. Please advised
me.



Best Regards.

-- 


Atentamente,

*
Juan Pablo Alvis Colmenares*
*Tecnólogo en Sistemas*
Cel 3142051048

-- 
You received this message because you are subscribed to the Google Groups 
"JPassion.com: Java Programming" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jpassion_java?hl=en.

Reply via email to