java 向下取整函数
时间: 2023-11-17 14:07:29 浏览: 110
java 使用取整函数
3星 · 编辑精心推荐
在Java中,向下取整的函数是Math.floor()。它会返回一个最接近给定浮点数且小于或等于该浮点数的整数值。 例如,对于1.9,Math.floor(1.9)将返回1.0,而对于-1.9,Math.floor(-1.9)将返回-2.0。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [JAVA中取整数的四种方法](https://blog.csdn.net/qq_63802547/article/details/127818807)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Java中的取整函数](https://blog.csdn.net/Coder_kiwi/article/details/109280766)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文