pow

This function computes the value of a var chosen by the user, multiplied by itself x times.

POW

NAME

pow - This function computes the value of a var chosen by the user, multiplied by itself x times.

SYNOPSIS

pow(variable,exposant)

DESCRIPTION

This mathematical function allows the user to compute the value of y multiplied by itself x times where x and y are variables chosen by the user. X and y have to be real numbers. If x is a negative number, then yˆx=1/(yˆx) where is x is simply the modulo of its latter value.

PARAMETERS

number
Specify the number (float) used as argument for the power function, and the variable multiplied by itself x times.

RETURN

The value of y multiplied by itself x times, x and y are chosen by the user.

EXAMPLES

One can use this function with integers:

test(q(res=<{pow(3,2);}>.),q(res=9.));

With floats:

test(q(res=<{pow(3,2.5);}>.),q(res=15.5885.));

One can use this function with another variable:

test(q(res=<{
%include "/includes/extenso.sn";
a=3;
pow(a,a);
}>.),
q(res=27.));

With a trigonometric function:

test(q(res=<{
%include "/includes/extenso.sn";
a=cos(0);
pow(a,4);
}>.),
q(res=4.));

With negative numbers:

test(q(res=<{pow(2,-2);}>.),q(res=.25.));

One can also consider the limits:

test(q(res=<{pow(-E,NF);}>.),q(res=1.));

With an array, it simply considers its number of elements:

test(q(res=<{pow([1,2],2);}>.),q(res=4.));

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

1.1 2016-01-08 laplante@sednove.com From version 5.36 the order of pow has been change.

Edit

© 2024 extenso Inc. All rights reserved.