Exp2


Function Exp2( numeric expression )


Returns 2^numeric expressionth power.


Syntax a = Exp2( x )


Remarks


x must resolve to a floating point number.

The return value is 2 raised to the xth power.


See Also:

Exp Exp10 Log2 Math Functions


Example Script


' Let's enumerate the powers of 2 from 0 to 7

NUMBER i

FOR i = 0 TO 7

PRINT " 2 ^"; i; " is "; EXP2(i)

PRINT " or it could be "; 2 ^ i

NEXT i


Script Output


2 ^0 is 1

or it could be 1

2 ^1 is 2

or it could be 2

2 ^2 is 4

or it could be 4

2 ^3 is 8

or it could be 8

2 ^4 is 16

or it could be 16

2 ^5 is 32

or it could be 32

2 ^6 is 64

or it could be 64

2 ^7 is 128

or it could be 128