1#pragma once 2 3#include <stdlib.h> 4 5#if __cplusplus >= 201703L 6extern int abs (int __x) throw() __attribute__ ((__const__)) ; 7extern long int labs (long int __x) throw() __attribute__ ((__const__)) ; 8extern float fabs (float __x) throw() __attribute__ ((__const__)) ; 9#else 10extern int abs (int __x) __attribute__ ((__const__)) ; 11extern long int labs (long int __x) __attribute__ ((__const__)) ; 12extern float fabs (float __x) __attribute__ ((__const__)) ; 13#endif 14 15namespace std 16{ 17 18using ::abs; 19 20inline long 21abs(long __i) { return __builtin_labs(__i); } 22 23inline long long 24abs(long long __x) { return __builtin_llabs (__x); } 25 26float fabs(float __x) { return __builtin_fabs(__x); } 27 28float abs(float __x) { return fabs(__x); } 29double abs(double __x) { return fabs(__x); } 30 31} 32