Mercator
|
00001 // This file may be redistributed and modified only under the terms of 00002 // the GNU General Public License (See COPYING for details). 00003 // Copyright (C) 2003 Alistair Riddoch 00004 00005 #ifndef MERCATOR_IROUND_H 00006 #define MERCATOR_IROUND_H 00007 00008 #ifndef PACKAGE 00009 #error iround.h must be included after config.h 00010 #endif 00011 00012 #ifdef HAVE_LRINTF 00013 #define I_ROUND(_x) (::lrintf(_x)) 00014 #elif defined(HAVE_RINTF) 00015 #define I_ROUND(_x) ((int)::rintf(_x)) 00016 #elif defined(HAVE_RINT) 00017 #define I_ROUND(_x) ((int)::rint(_x)) 00018 #else 00019 #define I_ROUND(_x) ((int)(_x)) 00020 #endif 00021 00022 #ifdef HAVE_FABSF 00023 #define F_ABS(_x) (::fabsf(_x)) 00024 #else 00025 #define F_ABS(_x) (::fabs(_x)) 00026 #endif 00027 00028 #endif // MERCATOR_IROUND_H