Re: Need help to convert my C++ codes to Java with GUI
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 23 Feb 2008 22:08:26 GMT
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
.
- Follow-Ups:
- References:
- Need help to convert my C++ codes to Java with GUI
- From: vampireex
- Re: Need help to convert my C++ codes to Java with GUI
- From: Roedy Green
- Re: Need help to convert my C++ codes to Java with GUI
- From: Katak
- Re: Need help to convert my C++ codes to Java with GUI
- From: Katak
- Re: Need help to convert my C++ codes to Java with GUI
- From: Jeff Higgins
- Need help to convert my C++ codes to Java with GUI
- Prev by Date: Re: Need help to convert my C++ codes to Java with GUI
- Next by Date: Re: Need help to convert my C++ codes to Java with GUI
- Previous by thread: Re: Need help to convert my C++ codes to Java with GUI
- Next by thread: Re: Need help to convert my C++ codes to Java with GUI
- Index(es):