Why does specifying a numeric value for a control property in the constructor result in a new decimal value (new int [] {... in the code?

In my C # .Net WinForm application in VS2005, I have a NumericUpDown control. In the constructor, I set the Minimum property for NumericUpDown to -65535.

In the code for the .designer.cs form, I expected to see the following:

this.myNumericUpDown.Minimum = -65535;

but instead I get:

    this.myNumericUpDown.Minimum = new decimal(new int[] {
    65535,
    0,
    0,
    -2147483648}); 

I know what this means by looking at the int32 [] decimal constructor , but why does the designer use this form instead of putting the value I entered, or even using the decimal int32 constructor ?

+3
source share
2

. , ( Left, Top ..), . , -, , , , . , . , , . , int [] , .

BTW, :

  • bits - 32- .
  • bits [0], [1] [2] , 32 96- .
  • [3] :
    • 0 15, , .
    • 16 23 0 28, 10 .
    • 24 30 .
    • 31 ; 0 , 1 .

Update:

: "... ,... ..." ?

. " , ". , , , , "-65535". - decimal.Parse(...). , NumericUpDown.Minimum. xxxx.Designer.cs, . , "-65535", , .

, " ...", , , , , - , .

, , . - , #, ++, SQL JScript, , :)

+3

, 0 - /.

this.myNumericUpDown.Minimum = new decimal(new int[] {
    65535,
    0,
    0,
    -2147483648}); // -2147483648 == 10000000000000000000000000000000b
                   // => only sign bit is set
0

Source: https://habr.com/ru/post/1719401/


All Articles