SyntaxFix
Write A Post
Hire A Developer
Questions
A possible way is to use the modulo operator to only let the values stay in the int32 range, and then cast it to int.
var intValue= (int)(longValue % Int32.MaxValue);