Mercator
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 MERCATOR_IROUND_H
6 #define MERCATOR_IROUND_H
7 
8 #ifndef PACKAGE
9 #error iround.h must be included after config.h
10 #endif
11 
12 #ifdef HAVE_LRINTF
13  #define I_ROUND(_x) (::lrintf(_x))
14 #elif defined(HAVE_RINTF)
15  #define I_ROUND(_x) ((int)::rintf(_x))
16 #elif defined(HAVE_RINT)
17  #define I_ROUND(_x) ((int)::rint(_x))
18 #else
19  #define I_ROUND(_x) ((int)(_x))
20 #endif
21 
22 #ifdef HAVE_FABSF
23  #define F_ABS(_x) (::fabsf(_x))
24 #else
25  #define F_ABS(_x) (::fabs(_x))
26 #endif
27 
28 #endif // MERCATOR_IROUND_H