views:

24

answers:

0

An user must enter a number into a mask-edit control. But that number is, depending on the underlying property, one of any .NET numeric type.

For instance. If the property is sbyte, the maximum number the user can enter (with any digit, from 0 to 9) is 99 and the minimum is -99 (because sbyte ranges from -128 to 127). That is something like the max X^10 - 1 that the type sbyte can support, where X is 100 (but -1 because 100 uses 3 digits, which would make the user type an overflown number).

For integers there is no problem, but for the decimal parts of float or double i don't know... How to get the max (X^10 - 1) number that the decimal part, of a floating-point type, can support?