Below when the number goes negative, I get a large number (4294967290), which is not correct, do anyone know why. I know that Round function returns a double. The large number is 4294967290. What to do see the exact negative number
test4 = (uint)Math.Round((m_abortTime - DateTime.Now,3).TotalSeconds);
Loading

VulpesRank #55 · 29.2K reputationPosted Jul 3, 2013, 10:35 AM EDT
As a general rule, it's best to avoid the unsigned integral types unless you really need the additional range or you're inter-operating with unmanaged code which uses unsigned types.
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 3, 2013, 10:01 AM EDT
The limits for int (32 bit) are:
int: –2147483648 to 2147483647
uint: 0 to 4294967295 And for long (64 bit):
long: -9223372036854775808 to 9223372036854775807
ulong: 0 to 18446744073709551615
David SmithRank #999 · 2K reputationPosted Jul 3, 2013, 11:41 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 3, 2013, 12:52 PM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 3, 2013, 7:03 PM EDT
hi,
As per my knowledge maximum value is supported by uint is 4294967295, when you trying to assign nagative value or cast nagative value then it perform substraction.
Example:
int j = 0;
uint kkk = (uint)(j - 23232);
interanlly it perform 4294967295 + 0 - 23232 + 1 = 4294944064
this only true for nagative value
hope this will help you.