function

exp2 . math . sncode

VERSIONlatest This function computes the value of 2 multiplied by itself x times.

EXP2(1e)

NAME

exp2 - This function computes the value of 2 multiplied by itself x times.

SYNOPSIS

exp2 (argument)

DESCRIPTION

This mathematical function allows the user to compute the value of 2 multiplied by itself x times, x being the variable chosen by the user. X can be either positive or negative, an integer or a float, but it has to be a real number. If x is a negative number, then 2 exp(-1)=1/2.

PARAMETERS

NUMBER
Specifies the number (float) used as argument for the exp2 function.

RETURN

The value of 2 multiplied by itself x times, the var chosen by the user.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

One can use this function with another variable:

test(q(res={_{
%include "/includes/extenso.sn";
a=0;
exp2(0);
}}.),
q(res=1.));

With a trigonometric function:

test(q(res={_{
%include "/includes/extenso.sn";
a=cos(0);
exp2(a);
}}.),
q(res=2.));

With integers:

test(q(res={_{exp2(3);}}.),q(res=8.));

With negative numbers:

test(q(res={_{exp2(-1);}}.),q(res=.5.));

With floats:

test(q(res={_{exp2(3.4);}}.),q(res=10.5561.));

With an array:

test(q(res={_{exp2(0,-1,3);}}.),q(res=\[1,.5,8\].));

One can also consider the limits:

test(q(res={_{exp2(INF);}}.),q(res=INF.));

AUTHOR

Written by Caroline Laplante, <claplante@sednove.com>