You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
770 B
32 lines
770 B
#pragma once
|
|
|
|
#include <stdlib.h>
|
|
|
|
#if __cplusplus >= 201703L
|
|
extern int abs (int __x) throw() __attribute__ ((__const__)) ;
|
|
extern long int labs (long int __x) throw() __attribute__ ((__const__)) ;
|
|
extern float fabs (float __x) throw() __attribute__ ((__const__)) ;
|
|
#else
|
|
extern int abs (int __x) __attribute__ ((__const__)) ;
|
|
extern long int labs (long int __x) __attribute__ ((__const__)) ;
|
|
extern float fabs (float __x) __attribute__ ((__const__)) ;
|
|
#endif
|
|
|
|
namespace std
|
|
{
|
|
|
|
using ::abs;
|
|
|
|
inline long
|
|
abs(long __i) { return __builtin_labs(__i); }
|
|
|
|
inline long long
|
|
abs(long long __x) { return __builtin_llabs (__x); }
|
|
|
|
float fabs(float __x) { return __builtin_fabs(__x); }
|
|
|
|
float abs(float __x) { return fabs(__x); }
|
|
double abs(double __x) { return fabs(__x); }
|
|
|
|
}
|