Say I have the following functions:
public int Compute(int a, int b, int c)
{
return (a + b +c)/3;
}
public double Compute(double a, double b, double c)
{
return ((a + b + c) / 3.0) / 209;
}
I hope the difference is obvious. A double value needs to be divided by 209 (a constant value) while an integer is not.
What is the best way to combine these two functions in a single one using generics?