Name:

max determines which of given constant expressions has maximum value

Library names:

sollya_obj_t sollya_lib_max(sollya_obj_t, ...) sollya_obj_t sollya_lib_v_max(sollya_obj_t, va_list)

Usage:

max(expr1,expr2,...,exprn) : (constant, constant, ..., constant) -> constant max(l) : list -> constant

Parameters:

• expr are constant expressions.
• l is a list of constant expressions.

Description:

• max determines which of a given set of constant expressions expr has maximum value. To do so, max tries to increase the precision used for evaluation until it can decide the ordering or some maximum precision is reached. In the latter case, a warning is printed indicating that there might actually be another expression that has a greater value.
• Even though max determines the maximum expression by evaluation, it returns the expression that is maximum as is, i.e. as an expression tree that might be evaluated to any accuracy afterwards.
• max can be given either an arbitrary number of constant expressions in argument or a list of constant expressions. The list however must not be end-elliptic.
• Users should be aware that the behavior of max follows the IEEE 754-2008 standard with respect to NaNs. In particular, max evaluates to NaN if and only if all arguments of max are NaNs. This means that NaNs may disappear during computations.

Example 1:

> max(1,2,3,exp(5),log(0.25));
148.41315910257660342111558004055227962348766759388
> max(17);
17

Example 2:

> l = [|1,2,3,exp(5),log(0.25)|];
> max(l);
148.41315910257660342111558004055227962348766759388

Example 3:

> print(max(exp(17),sin(62)));
exp(17)

Example 4:

> verbosity = 1!;
> print(max(17 + log2(13)/log2(9),17 + log(13)/log(9)));
Warning: the tool is unable to decide a maximum computation by evaluation even though faithful evaluation of the terms has been possible. The terms will be considered to be equal.
17 + log2(13) / log2(9)
See also: min, ==, !=, >=, >, <, <=, in, inf, sup
Go back to the list of commands