码迷,mamicode.com
首页 > 其他好文 > 详细

模板:abs用法

时间:2014-12-03 23:18:37      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:http   使用   sp   文件   bs   ad   html   linux   tt   

c语言书本上说,数学函数除了求整数的绝对值函数abs()之外<abs() 定义在stdlib.h中>,其余的函数都在头文件 math.h 中定义,包括对浮点数求绝对值的函数fabs()。
c++中,包含的相应的头文件为,原则是前面加c,同时去掉.h 。
例如:
#include <cstdlib>对应        #include <stdlib.h>
#include <cmath>对应        #include <math.h>

于是,在c++里        
                使用abs()就用 #include <cstdlib>
                使用fabs()就用 #include <cmath>

 

http://www.linuxdiyf.com/bbs/thread-188460-1-1.html

模板:abs用法

标签:http   使用   sp   文件   bs   ad   html   linux   tt   

原文地址:http://www.cnblogs.com/mobileliker/p/4141495.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!