我有一个for循环,它一直递增一个整数值,直到循环完成.因此,如果限制n是双变量并且递增变量'i'是整数,则i增加超出其限制.
double total = 0;
double number = hugetValue;
for (int i = 1; i <= number; i++)
{
total = total + i;
}
return total;
Run Code Online (Sandbox Code Playgroud)
如果'i'超出其容量,会发生什么?我的价值如何变化?我会收到运行时错误吗?
谢谢
NLV