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



On Sat, 23 Feb 2008 20:42:18 -0800 (PST), Katak
<vampireex@xxxxxxxxxxx> wrote, quoted or indirectly quoted someone who
said :

Sorry. I think it was meant to be exponent since I was doing decimal =
binary * 2^1 , decimal = binary * 2*2, etc. Named it wrongly.

In that case you can often use a loop to incrementally create a power,
especially if you need to intermediate values.

pow *= base;

You can create powers of two with left shifts. e.g.

1 << 3 == 8
--

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