Goto main content

cbrt

This function computes the cube root of a number.

CBRT

NAME

cbrt - This function computes the cube root of a number.

SYNOPSIS

cbrt(number)

DESCRIPTION

This mathematical function computes the cube root of a number in the real plane. It returns a number y whose cube is x, meaning that y multiplied by itself 2 times equals x (y*y*y=x). X and y can both be positive or negative.

PARAMETERS

Number
Specify the number (float) used as argument for the cbrt function.

RETURN

Cube root
The cube root value of the argument.

EXAMPLES

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

One can use this function with a variable :

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

With a trigonometric function:

test(q(res={_{
%include "/includes/extenso.sn";
a=cos(PI);
cbrt(a);
}}.),
q(res=-1.));

With floats:

test(q(res={_{cbrt(0.99);}}.),q(res=.996655.));

With big integers:

test(q(res=3.5568933.),q(res=3.55689.));

With negative numbers:

test(q(res={_{cbrt(-8);}}.),q(res=-2.));

With an array:

test(q(res={_{cbrt(256,0,27);}}.),q(res=\[6.3496,0,3\].));

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.