add QuantizeUp

This commit is contained in:
Glenn Maynard
2004-12-22 04:07:42 +00:00
parent 95eb10b834
commit 7d285a5731
+6
View File
@@ -166,6 +166,12 @@ inline float ftruncf( const float f, const float fTruncInterval )
return int( (f)/fTruncInterval ) * fTruncInterval;
}
/* Return i rounded up to the nearest multiple of iInterval. */
inline int QuantizeUp( int i, int iInterval )
{
return int( (i+iInterval-1)/iInterval ) * iInterval;
}
// Move val toward other_val by to_move.
void fapproach( float& val, float other_val, float to_move );