真的很简单,但也许有人可以解释.我有2行代码:
long millisPerYear = 365*24*60*60*1000;
System.out.println("millis per year = " + millisPerYear);
Run Code Online (Sandbox Code Playgroud)
我预计产量为31 536 000 000,但我得到1 471 228 928.
如果我从公式中删除1000,答案是正确的,但是1000将其推到边缘.
变量格式是Long这样的,它的大小应该是2 64,足够大.我很难过为什么没有准确地存储这些值.
我正在学习PHP,我希望你能解释为什么购物车教程的作者在调用时将产品添加到购物车中.
if(isset($_GET['action']) && $_GET['action']=="add")
Run Code Online (Sandbox Code Playgroud)
站点检查$_GET[action]已设置和那个$_GET[action]在处理之前等于"添加"但是在功能上不等同于:
if($_GET['action']=="add")
Run Code Online (Sandbox Code Playgroud)
因为如果值是'add',则必须设置它,如果没有设置,它可能不能'添加'正确吗?或者我错过了什么?