Is there a way to declare a generic function that the generic type is of type1 or type2?
example:
public void Foo(T number) { }
I don't think this is currently possible.
This question about creating a math library sort of covers the same ground, and includes some work arounds.