RedditPP Mascot

RedditPP

r/csharp • … • u/somedave

Interface for addition and subtraction

If I'm making a generic type function e.g.

static T Diff<T>(T x, T y) => x - y;

Is there an interface I can say T has that this will be defined for double, float, long, int etc?

— 0