fix and simplify

This commit is contained in:
Glenn Maynard
2003-06-30 04:41:53 +00:00
parent 4fc640e623
commit 75d3b3b13e
+3 -2
View File
@@ -109,10 +109,11 @@ inline double trunc( double f ) { return float(int(f)); };
#else #else
#include <math.h> #include <math.h>
#endif #endif
#if defined(NEED_TRUNCF)
inline float truncf( float f ) { return float(int(f)); }; inline float truncf( float f ) { return float(int(f)); };
#ifndef HAVE_ROUNDF #endif
#if defined(NEED_ROUNDF)
inline float roundf( float f ) { if(f < 0) return truncf(f-0.5f); return truncf(f+0.5f); }; inline float roundf( float f ) { if(f < 0) return truncf(f-0.5f); return truncf(f+0.5f); };
inline double roundf( double f ){ if(f < 0) return trunc(f-0.5); return trunc(f+0.5); };
#endif #endif
inline float froundf( const float f, const float fRoundInterval ) inline float froundf( const float f, const float fRoundInterval )
{ {