1.Math.round():根据“round”的字面意思“附近、周围”,可以猜测该函数是求一个附近的整数,看下面几个例子就明白。
小数点后第一位<5
正数:Math.round(11.46)=11
负数:Math.round(-11.46)=-11
小数点后第一位>5
正数:Math.round(11.68)=12
负数:Math.round(-11.68)=-12
小数点后第一位=5
正数:Math.round(11.5)=12
负数:Math.round(-11.5)=-11
总结:(小数点后第一位)大于五全部加,等于五正数加,小于五全不加。
2.Math.ceil():根据“ceil”的字面意思“天花板”去理解;
例如:
Math.ceil(11.46)=Math.ceil(11.68)=Math.ceil(11.5)=12
Math.ceil(-11.46)=Math.ceil(-11.68)=Math.ceil(-11.5)=-11
3.Math.floor():根据“floor”的字面意思“地板”去理解;
例如:
Math.floor(11.46)=Math.floor(11.68)=Math.floor(11.5)=11
Math.floor(-11.46)=Math.floor(-11.68)=Math.floor(-11.5)=-12
每日集成CruiseControl.NET + SVN + Msbuild + NAnt
通过spring.net中的spring.caching CacheResult实现memcached缓存
c# 简单文件流读写CSV文件
ajax系列之用jQuery的ajax方法向服务器发出get和post请求
我的2016书单以及为2017年准备的书单
微信网页开发之获取用户unionID的两种方法--基于微信的多点登录用户识别
微信开发之分清公众平台和开放平台、公众号全局凭证和网页授权凭证
网站实现微信登录之回调函数中登录逻辑的处理--基于yii2开发的描述
网站实现微信登录之嵌入二维码——基于yii2开发的描述