Tag: numbers
-
How can I multiply a INumber with an int?
15 How should I implement the multiplication by int (z * 2) on the last line? public static TResult Test<TResult>() where TResult : INumber<TResult> { TResult x = TResult.AdditiveIdentity; TResult y = TResult.MultiplicativeIdentity; TResult z = x * y; TResult z2 = z * 2; // <— this gives the CS0019 error "The operator *…