It compiles
var fourGb = (long)4*1024*1024*1024;
But it fails
var fourGb = 4*1024*1024*1024;
C "Overflow of operation during compilation in check mode."
So, if the compiler knows that this will be an overflow, why not conclude that the type of the variable should be long?
Imagine the noise that can cause. "But the compiler can understand that an expression has to be evaluated for so long, why can't it?"
And that won't happen, too expensive.
, , . , . , .
. http://msdn.microsoft.com/en-us/library/ctetwysk%28VS.80%29.aspx
int, int #. L, .
var fourGb = 4L * 1024 * 1024 * 1024;
, , .
:
Perhaps you have:
double varname = 1/2
Source: https://habr.com/ru/post/1755659/More articles:php mb_convert_case () save words in uppercase - stringFinding the roots of a function adjacent to imaginary numbers - mathHow can I catch jQTouch animation completion? - jqueryHow to get the last but not empty line in a txt file - c ++NetLogo - What is the 1 unit of distance measurement in NetLogo? - netlogoPassing boost :: signal as a function of boost :: - c ++Convert Python fragment to PHP? - pythonHow to get a log from Process.Start - c #Are there any advantages to opening a user session in a new window without a browser menu after the user logs in? - user-interfaceIPhone Contexts OpenGL ES and Framebuffers - iphoneAll Articles