Eris
1.3.19
|
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 ERIS_IROUND_H 00006 #define ERIS_IROUND_H 00007 00008 #ifndef PACKAGE 00009 #error iround.h must be included after config.h 00010 #endif 00011 00012 #ifdef HAVE_LLRINT 00013 #define L_ROUND(_x) (::llrint(_x)) 00014 #else 00015 #define L_ROUND(_x) ((long long)(_x)) 00016 #endif 00017 00018 #ifdef HAVE_LRINTF 00019 #define I_ROUND(_x) (::lrintf(_x)) 00020 #elif defined(HAVE_RINTF) 00021 #define I_ROUND(_x) ((int)::rintf(_x)) 00022 #elif defined(HAVE_RINT) 00023 #define I_ROUND(_x) ((int)::rint(_x)) 00024 #else 00025 #define I_ROUND(_x) ((int)(_x)) 00026 #endif 00027 00028 #ifdef HAVE_FABSF 00029 #define F_ABS(_x) (::fabsf(_x)) 00030 #else 00031 #define F_ABS(_x) (::fabs(_x)) 00032 #endif 00033 00034 #endif // ERIS_IROUND_H