Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

core.internal.util.math

Internal math utilities.
Authors:
Luís Ferreira
pure nothrow @nogc @safe T max(T)(T a, T b);
Calculates the maximum of the passed arguments
Parameters:
T a first value to select the maximum from
T b second value to select the maximum from
Returns:
The maximum of the passed-in values.
pure nothrow @nogc @safe T min(T)(T a, T b);
Calculates the minimum of the passed arguments
Parameters:
T a first value to select the minimum from
T b second value to select the minimum from
Returns:
The minimum of the passed-in values.
Examples:
assert(max(1,3) == 3);
assert(max(3,1) == 3);
assert(max(1,1) == 1);
Examples:
assert(min(1,3) == 1);
assert(min(3,1) == 1);
assert(min(1,1) == 1);