软件编程
位置:首页>> 软件编程>> C#编程>> C# 中如何取绝对值函数

C# 中如何取绝对值函数

作者:LJD泊水  发布时间:2022-11-17 10:43:53 

标签:C#,绝对值,函数

话不多说,请看代码:


System.Math.Abs(float value);
System.Math.Abs(decimal value);
System.Math.Abs(int value);
System.Math.Abs(double value);
System.Math.Abs(sbyte value);
System.Math.Abs(long value);
System.Math.Abs(short value);

PS:下面看下c++ 取绝对值函数

int abs(int   i) 返回整型参数i的绝对值    

  double cabs(struct   complex   znum) 返回复数znum的绝对值     

  double fabs(double   x) 返回双精度参数x的绝对值   

  long labs(long   n) 返回长整型参数n的绝对值  

 abs,   labs,   llabs,   imaxabs   -   compute   the   absolute   value   of   an   integer.    

SYNOPSIS   


     #include  <stdlib.h>  
       int  abs(int  j);  
       long  int  labs(long  int  j);  
       long  long  int  llabs(long  long  int  j);  
       #include  <inttypes.h>  
       intmax_t  imaxabs(intmax_t  j);

来源:http://www.cnblogs.com/lijianda/p/6603598.html

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com