math.round
时间: 2023-08-22 17:07:00 浏览: 107
Math.round()函数是数学中的四舍五入函数,它可以将一个浮点数四舍五入为最接近的整数。例如,Math.round(1.2)的结果是1,Math.round(1.5)的结果是2,Math.round(-1.2)的结果是-1,Math.round(-1.5)的结果是-1。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Math的几个方法Math.round()、Math.ceil()、Math.floor()和Math.abs()记录一下](https://blog.csdn.net/qq_41135254/article/details/104876917)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Math.round()方法](https://blog.csdn.net/zhoushumin157016/article/details/51984436)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文