A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/latest/lang/api/max.html below:

max() — Maple v0.0.12 Documentation

max()¶

(Macro) Calculates the maximum of two numbers.

Parameters¶

x: the first number; may be any number or numeric expression.

y: the second number; may be any number or numeric expression.

Returns¶

The larger of the two parameter values.

Example¶
sensVal = max(senVal, 20); // assigns sensVal to the larger of sensVal or 20
                           // (effectively ensuring that it is at least 20)

Note

Perhaps counter-intuitively, max() is often used to constrain the lower end of a variable’s range, while min() is used to constrain the upper end of the range.

Warning¶

Because of the way max() is implemented, avoid using other functions inside the parentheses. It may lead to incorrect results:

max(a--, 0);   // avoid this - yields incorrect results

a--;           // use this instead -
max(a, 0);     // keep other operations outside max()
Arduino Compatibility¶

The Maple implementation of max() is compatible with Arduino.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4