Monday, June 20, 2011

No power of operation in Java

Just found out that the usual power of (^) operation is not available in Java.

This wasted an hour of my time. So for anyone else who's about to try, please use Math.pow instead of this operator. And no, it doesn't give a compilation error either.

Instead of : 2 ^ 3, use Math.pow(2, 3).. tada, how convenient, NOT!

1 comment: