c++ 取絕對值函式
阿新 • • 發佈:2019-01-01
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);