Skip to content

power operator (^)

by admin on March 12th, 2017
put 8 ^ 2 into myFavoriteNumber

The “power” operator raises the given number to the given power. In non-mathematical terms, it multiplies the number to the left of it by itself as many times as the number to the right of it.

E.g. if you were to do 8 ^ 3 it would calculate the result of 8 * 8 * 8. If you specify 0 as the right argument, it will return the number 1, no matter what number is to its left.

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS