Mercurial > hg > svcore
changeset 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 | 68ff162fdbc3 |
children | f47f4c7c158c |
files | base/System.cpp base/System.h |
diffstat | 2 files changed, 14 insertions(+), 0 deletions(-) [+] |
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; } +
--- 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 <cmath> + +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_ */