1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +01:00

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
2014-12-08 22:42:36 +01:00
committed by Carlos R. Mafra
parent 723f217355
commit 4799df5506
5 changed files with 34 additions and 27 deletions

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);