Problem Description
Our current min/max provide two overloads for integer and float, but user cannot write code to use min/max on both integer and float, e.g.
T myMin<T>(T a, T b) where T: IArithmatic
{
return min(a, b);
}
myMin<float>(...);
myMin<int>(...);
this code won't work.
Preferred Solution
Though, user can still use if branch to check if T is float or integer in their implementation of myMin, and do the int cast or real cast then call min. However, this is complicated. I think we can re-implement min/max function to get rid of this complexity on user end. And this won't be a breaking change.