In. NET core, the int type with C # has a range of upper and lower values, as follows:
int int . MaxValue; int int . MinValue; Console.WriteLine ($"Therange of integers is {min} to {max}");
Run to get results
The range of integers is-2147483648 to 2147483647
At this point, if you execute the following code
int 3 ; Console.WriteLine ($"anexample of overflow: {what}");
Get the range result is
An example of overflow:-2147483646
It's strange that the execution max+3 get the result min+2
Check out the official tutorials
If a calculation produces a value that exceeds those limits, you had an underflow or overflow condition.
If the calculation produces a value that exceeds these limits, a underflow or overflow condition occurs.
Max+3 The overflow occurred, it became min+2.
This is another condition in Python.
Import SYS Print Sys.maxint
Get the maximum value 2147483647
Then perform the following
Print sys.maxint+3
Get 2147483650
See no, no overflow, originally python after int exceeds the maximum value, automatically convert it to a long type, so there is no overflow, as long as the memory is large enough.
dotnet Core in value overflow