Hello,
I need to calculate in a generic class. I#ve found some solutions like here: http://stackoverflow.com/questions/147646/solution-for-overloaded-operator-constraint-in-net-generics, but i need to calucate T with double. is it possible to cast T to double? So i can write code like this:
class Myclass<T>{
T value;
public double Half() {
return i.value / 2;
}
}
Myclass<int> i = new Myclass<int>();
double x = i.Half();
Thanks!