replaced all local definitions of PI by a single one

For code maintainability, it is better to have a single definition of the
constant than many ones dispatched in many places. In addition, we try to
count on the constant M_PI that can be defined by the header <math.h> if
possible because it may have the best accuracy for the platform.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS authored and Carlos R. Mafra committed 2014-12-10 10:19:19 +00:00
1 parent 723f217355
commit 4799df5506
5 files changed
+34 -27

No files matched your search

+1 -6
View File
@@ -27,11 +27,6 @@
#include <string.h>
#include <X11/Xlib.h>
#include <math.h>
#ifndef PI
#define PI 3.14159265358979323846
#endif
#include <assert.h>
#include "wraster.h"
@@ -200,7 +195,7 @@ static double sinc(double x)
* The goal was to avoid a Divide-by-0 error, now we also
* avoid a +/-inf result too
*/
x *= PI;
x *= WM_PI;
if (x > 1.0E-9)
return (sin(x) / x);
return (1.0);