Goto main content

fmax

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

FMAX

NAME

fmax - This function returns the biggest of the 2 var chosen by the user.

SYNOPSIS

fmax(number x, number 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.));

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.