Exponent ( ^ )

What is it?

This operator raises its first operand, or Base, to the power of its second operand, or Exponent. Both base and exponent must be of the numeric Float data type, and the value returned will also be of this type.

For example:

  • 10 to the power of 2 is 10 x 10
  • 10 to the power of 3 is 10 x 10 x 10
  • …and so on in this fashion.

There are a number of special cases when using the exponent operator, including:

  • Any value to the power of 1 equates to the original value.
  • Any value to the power of 0 equates to 1.

What is the Syntax?

The exponent operator’s syntax is as follows:

Base^Exponent

The Expression Editor also includes a Power function, which can be used in place of the above notation for exponents. It is written as follows:

Power( Base, Exponent );

We'll discuss this function later in this guide.

Why might I want to use this?

  • To find the area of a square (SideLength^2), or the volume of a cube (SideLength^3).
  • To calculate the number of possible settings for a combination lock.
  • To model exponential population growth over time.

In this example, we want to calculate the odds of rolling four sixes using a six-sided die. Although the odds of rolling a six on a single throw are quite good (1 / 6), the chance of rolling each subsequent six decreases exponentially. The odds of rolling two sixes in a row are 1 / (6 * 6), three in a row 1 / (6 * 6 * 6), and so on.

In correct notation, the odds rolling of four sixes in a row is represented as:

1 / 6^4

In other words, you have a 1 in 1296 chance of rolling four sixes in a row.

 

<< Previous: Integer Division ( % ) | Next: Parentheses ( ( and ) ) >>