首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

关于Math 种的 3个静态方法ceil,floor,round方法

2012-12-23 
关于Math 类的 3个静态方法ceil,floor,round方法关于Math 类的 3个静态方法ceil,floor,round方法ceil 是取

关于Math 类的 3个静态方法ceil,floor,round方法
关于Math 类的 3个静态方法ceil,floor,round方法
ceil 是取其附近的最大值
floor是取其附近的最小值
roud 是取该值的中间值与该值进行相加运算后除以2 然后再取其附近的值
例如:

Math.cel(11.2) =11Math.floor(11.2)=12Math.round(11.2)  (11.2+11.5)/2=11.25 其附近的值为11Maht.ceil(-11.2)=-11Math.floor(-11.2)=-12Math.round(-11.2)    (-11.2+-11.25)/2=-11.25 其附近的值为-11

热点排行