Exponentials
Previous  Next

Description: Exponentials are done by using the ^ operator. The ^ operator uses the entire left side of the expression as the <base> and the entire right side of the expression as the <exponent>.

Example:
    b = 1
    a = b+3^2
    PRINT a          ' Prints 16

    a = b+3^2+b
    PRINT a          ' Prints 64

If you want to isolate the <base> and <exponent>, you can use parenthesis to ensure that the exponent operator is restricted to those specific values.

Example:
    b = 1
    a = b+(3^2)
    PRINT a          ' Prints 10

    a = b+(3^2)+b
    PRINT a          ' Prints 11

Additional Information: The use of the POW() function and ^ operator will inherit the math.lib library.

See Also:
POW()