fmin - This function returns the smallest of the 2 var chosen by the user.
fmin(x,y)
This mathematical function returns the smallest value between the two variables x and y chosen by the user.
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={_{fmin(3,4);}}.),q(res=3.)); With floats: test(q(res={_{fmin(2.5,3);}}.),q(res=2.5.)); One can use this function with another variable: test(q(res={_{ %include "/includes/extenso.sn"; a=3; fmin(a,4); }}.), q(res=3.)); With a trigonometric function: test(q(res={_{ %include "/includes/extenso.sn"; a=cos(0); fmin(a,0); }}.), q(res=0.)); With negative numbers : test(q(res={_{fmin(-3,2);}}.),q(res=-3.)); One can also consider the limits: test(q(res={_{fmin(-INF,INF);}}.),q(res=-INF.)); With an array, it simply considers its number of elements: test(q(res={_{fmin(3,[1,2]);}}.),q(res=2.));
Written by Caroline Laplante, <claplante@sednove.com>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com