一分钟了解"c语言求绝对值函数abs"

来源:互联网 发布:java jersey restful 编辑:程序博客网 时间:2024/05/16 16:20

根据你的数据是int,long,还是double型,要用不同的函数

#include <math.h>


        iy   =   abs(   ix   );  //int型
   
        ly   =   labs(   lx   );  //long型
   
        dy   =   fabs(   dx   );  //double型