Re: Need help to convert my C++ codes to Java with GUI



On Sat, 23 Feb 2008 16:17:52 -0500, "Jeff Higgins"
<oohiggins@xxxxxxxxx> wrote, quoted or indirectly quoted someone who
said :

double cubed = Math.pow(2, power);

for cubed I would use double cubed = x * x * x;

Math.pow works by taking logs and exponentials, each of which is
computed with a whacking huge polynomial approximation. With the
arithmetic method, you don't lose precision on doubles that happen to
be perfect ints.

--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.