What is the “base class” for C# numeric value types?

后端 未结 6 1643
太阳男子
太阳男子 2020-12-01 11:44

Say I want to have a method that takes any kind of number, is there a base class (or some other concept) that I can use?

As far as I know I have to make overloads f

6条回答
  •  一个人的身影
    2020-12-01 12:30

    The short answer is: Numeric types are value types, hence they derive from System.ValueType. The full answer is: you should read this article from MSDN. Moreover I think that you should read C# language reference :). Value type not equals numeric type, because values types include also structures and enumerations.

提交回复
热议问题