fmax . math . sncode
latest
This function returns the biggest of the 2 var chosen by the user.
FMAX(1e)
NAME
fmax - This function returns the biggest of the 2 var chosen by the user.
SYNOPSIS
fmax(x,y)
DESCRIPTION
This mathematical function returns the biggest value between the two variables x and y chosen by the user.
PARAMETERS
- NUMBER
- Specifies the two numbers (float) used as argument for the fmax function.
RETURN
- The biggest number between x and y.
EXAMPLES
Note: In the followings examples, the _ between the { should be removed to make it work.
One can use this function with integers: test(q(res={_{fmax(3,4);}}.),q(res=4.)); With floats: t(q(res={_{fmax(2.5,3);}}.),q(res=3.)); One can use this function with another variable: test(q(res={_{ %include "/includes/extenso.sn"; a=3; fmax(a,4); }}.), q(res=4.)); With a trigonometric function: test(q(res={_{ %include "/includes/extenso.sn"; a=cos(0); fmax(a,0); }}.), q(res=1.)); With negative numbers: test(q(res={_{fmax(-3,2);}}.),q(res=2.)); One can also consider the limits: test(q(res={_{fmax(-INF,INF);}}.),q(res=INF.)); With an array, it simply considers its number of elements: test(q(res={_{fmax(3,[1,2]);}}.),q(res=3.));
AUTHOR
Written by Caroline Laplante, <claplante@sednove.com>