Maximum value of "enum"


How to get maximum value of enumeration? Like this:

enum SomeEnumeration {
  A = 1,
  B = 2,
  H = 30

Maybe this will work?


Got it from here:

It depends if you specify a base type or not

If the enum contains floating point types, it'll be 7.9 1028 (via Decimal)

If it's an integer type, it'll be 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (via long)

Generally it'll use int and float until the higher ranges are needed

Note - added this because it was a little ambiguous whether you wanted the highest used or the highest possible