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!

One thought on “No power of operation in Java

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s