public static T Add<T>(T num1, T num2) where T : struct, IComparable
{
if (typeof(T) == typeof(int))
{
int a = (int)Convert.ChangeType(num1, typeof(int));
int b = (int)Convert.ChangeType(num2, typeof(int));
int c = a + b;
return (T)Convert.ChangeType(c, typeof(T));
}
else if (typeof(T) == typeof(float))
{
float a = (float)Convert.ChangeType(num1, typeof(float));
float b = (float)Convert.ChangeType(num2, typeof(float));
float c = a + b;
return (T)Convert.ChangeType(c, typeof(T));
}
else if (typeof(T) == typeof(double))
{
double a = (double)Convert.ChangeType(num1, typeof(double));
double b = (double)Convert.ChangeType(num2, t