c++ float 取绝对值
时间: 2023-11-02 15:06:49 浏览: 155
要计算浮点数c的绝对值,可以使用C语言的math.h头文件中的abs()函数。在你提供的例子中,使用了cmath头文件,该头文件也包含了abs()函数。因此,可以使用abs(c)来计算c的绝对值。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [c++求绝对值](https://blog.csdn.net/friendan/article/details/8801462)[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入门到精通自学视频课程-08、继承:概述、案例.rar](https://download.csdn.net/download/weixin_54787054/88280693)[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 ]
阅读全文