Is it possible to write a function pow(T number,T exponent), T being a numeric type in C#?

Viewed 42

What I mean is:

  • is it possible to have a generic numeric function in C# aiming to avoid the use of overloads for different numeric types such int, byte, double, float,...,vectors of int, ... , matrixes of complex numbers, weird never-seen-before structures that behave like numbers for some reason ecc..?

  • if not C# is there a language which can handle these kind of problems in a better way?

Thanks in advance.

0 Answers
Related