Goto main content

exp2

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

EXP2

NAME

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

SYNOPSIS

exp2 (number)

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.));

SEE ALSO

{{ include("includes/maths.sn") }}

AUTHOR

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

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.