# HG changeset patch # User Chris Cannam # Date 1151338081 0 # Node ID 514ebb0c5c6c2a9eaa74c33ebff15283b5429a6c # Parent 68ff162fdbc339f6fa1b5e0fea7f2e330e421acf * add mod/modf and princarg/princargf to system header (for now) diff -r 68ff162fdbc3 -r 514ebb0c5c6c base/System.cpp --- 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; } + diff -r 68ff162fdbc3 -r 514ebb0c5c6c base/System.h --- a/base/System.h Mon Jun 26 16:07:31 2006 +0000 +++ b/base/System.h Mon Jun 26 16:08:01 2006 +0000 @@ -75,6 +75,14 @@ enum ProcessStatus { ProcessRunning, ProcessNotRunning, UnknownProcessStatus }; extern ProcessStatus GetProcessStatus(int pid); +#include + +extern double mod(double x, double y); +extern float modf(float x, float y); + +extern double princarg(double a); +extern float princargf(float a); + #endif /* ! _SYSTEM_H_ */