Mercurial > hg > svcore
diff base/System.cpp @ 127:514ebb0c5c6c
* add mod/modf and princarg/princargf to system header (for now)
author | Chris Cannam |
---|---|
date | Mon, 26 Jun 2006 16:08:01 +0000 |
parents | ac89a106f155 |
children |
line wrap: on
line diff
--- a/base/System.cpp Mon Jun 26 16:07:31 2006 +0000 +++ b/base/System.cpp Mon Jun 26 16:08:01 2006 +0000 @@ -70,3 +70,9 @@ #endif } +double mod(double x, double y) { return x - (y * floor(x / y)); } +float modf(float x, float y) { return x - (y * floorf(x / y)); } + +double princarg(double a) { return mod(a + M_PI, -2 * M_PI) + M_PI; } +float princargf(float a) { return modf(a + M_PI, -2 * M_PI) + M_PI; } +