We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type
System.IComparable<T>
Extension method signature
T Max<T>(T); T Min<T>(T);
Parameters
T
Description Returns the maximum/minimum of two values.
Benefits Math.Min() and Math.Max only support primitives and do not support generic comparable types.
Math.Min()
Math.Max
Drawbacks None considered (at this time)
(Optional) Implementation example
{ return value.GreaterThan(other) ? value : other; // or return value.LessThan(other) ? value : other; }
The text was updated successfully, but these errors were encountered:
✨ Add IComparable<T> Max and Min
ac8aead
Implements #23
Implemented with ac8aead
Sorry, something went wrong.
oliverbooth
No branches or pull requests
Type
Extension method signature
Parameters
T
Description
Returns the maximum/minimum of two values.
Benefits
Math.Min()
andMath.Max
only support primitives and do not support generic comparable types.Drawbacks
None considered (at this time)
(Optional) Implementation example
The text was updated successfully, but these errors were encountered: