fmin

This function returns the smallest of the 2 var chosen by the user.

FMIN

NAME

fmin - This function returns the smallest of the 2 var chosen by the user.

SYNOPSIS

fmin(number x,number y)

DESCRIPTION

This mathematical function returns the smallest value between the two variables x and y chosen by the user.

PARAMETERS

NUMBER
Specifies the two numbers (float) used as argument for the fmin function.

RETURN

The smallest 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={_{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.));

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.