add fmodfp

This commit is contained in:
Glenn Maynard
2003-02-05 20:18:02 +00:00
parent 4947182487
commit 379e3e43ec
2 changed files with 12 additions and 0 deletions
+9
View File
@@ -25,6 +25,15 @@
unsigned long randseed = time(NULL);
/* Return a positive x mod y. */
float fmodfp(float x, float y)
{
x = fmodf(x, y); /* x is [-y,y] */
x += y; /* x is [0,y*2] */
x = fmodf(x, y); /* x is [0,y] */
return x;
}
int power_of_two(int input)
{
int value = 1;
+3
View File
@@ -113,6 +113,9 @@ inline float froundf( const float f, const float fRoundInterval )
return int( (f + fRoundInterval/2)/fRoundInterval ) * fRoundInterval;
}
/* Return a positive x mod y. */
float fmodfp(float x, float y);
int power_of_two(int input);
bool IsAnInt( const CString &s );
bool IsHexVal( const CString &s );