S. Peter S. Peter - 2 months ago 6
C# Question

Parse uint to positive long and have a 1 to 1 matching

Is there a safe way to parse Uint numbers into positive Long numbers and have a one to one matching between that uint and the long number??

Answer
uint i = 0;
long o = Convert.ToInt64(i);

or

uint i = 0;
long o = (long)i;
Comments