ceil中有-0啊

 
 
 
这里主要是有一点:
1
Math.ceil(d1) 
ceil 方法上有这么一段注释:If the argument value is less than zero but greater than -1.0, then the result is negative zero
如果参数小于0且大于-1.0,结果为 -0
1
Math.floor(d1)
ceil 和 floor 方法 上都有一句话:If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as  the argument,意思为:如果参数是 NaN、无穷、正 0、负 0,那么结果与参数相同,
如果是 -0.0,那么其结果是 -0.0
原文地址:https://www.cnblogs.com/albertshine/p/13259857.html