Eris  1.3.19
iround.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU General Public License (See COPYING for details).
3 // Copyright (C) 2003 Alistair Riddoch
4 
5 #ifndef ERIS_IROUND_H
6 #define ERIS_IROUND_H
7 
8 #ifndef PACKAGE
9 #error iround.h must be included after config.h
10 #endif
11 
12 #ifdef HAVE_LLRINT
13  #define L_ROUND(_x) (::llrint(_x))
14 #else
15  #define L_ROUND(_x) ((long long)(_x))
16 #endif
17 
18 #ifdef HAVE_LRINTF
19  #define I_ROUND(_x) (::lrintf(_x))
20 #elif defined(HAVE_RINTF)
21  #define I_ROUND(_x) ((int)::rintf(_x))
22 #elif defined(HAVE_RINT)
23  #define I_ROUND(_x) ((int)::rint(_x))
24 #else
25  #define I_ROUND(_x) ((int)(_x))
26 #endif
27 
28 #ifdef HAVE_FABSF
29  #define F_ABS(_x) (::fabsf(_x))
30 #else
31  #define F_ABS(_x) (::fabs(_x))
32 #endif
33 
34 #endif // ERIS_IROUND_H