C# 7 binary literal for -1
.net, c#, c#-7.0
Solution
After trying some cases, I finally found out this one
int x = -0b000_0000_0000_0000_0000_0000_0000_0001;
Console.WriteLine(x);
And as result is printed -1.
If I understand everything correct they use sing flag for -/+ so when you put 32 1 you go into uint
Problem
I want to declare `-1` literal using the new binary literal feature: ``` int x = 0b1111_1111_1111_1111_1111_1111_1111_1111; Console.WriteLine(x); ``` However, this doesn't work because C# considers this as a `uint` literal and we get `Cannot implicitly convert type 'uint' to 'int'...` which is a bit strange for me since we deal with binary data. Is there a way to declare `-1` integer value using binary literal in C#?