How do I use constraints to represent basic mathematical types #102614
Replies: 1 comment
-
This depends on what your generic method should actually do. If you only want to do arithmethic on either integer types or either floating point types, use If however you want to do also arithmethic between integers and floating point types, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want a method that can be applied to bytes, sbyte, short, ushort, ... .
The INumber interface seems to only specify how to perform operations on its own type. Unable with constant int, double type interaction.
The preset basic type is achieved through conversion.
But this interface does not mention conversion.
Beta Was this translation helpful? Give feedback.
All reactions