fix abs(-0), which shall evaluate to +0

This commit is contained in:
rlar 2016-06-13 19:41:17 +02:00
parent 8f44e9da44
commit 4d95360a68
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ typedef struct {
#endif
/* Some defines used mainly in cmath.c. */
#define FTEcabs(d) (((d) < 0.0) ? - (d) : (d))
#define FTEcabs(d) fabs(d)
#define cph(c) (atan2(imagpart(c), (realpart(c))))
#define cmag(c) (hypot(realpart(c), imagpart(c)))
#define radtodeg(c) (cx_degrees ? ((c) / 3.14159265358979323846 * 180) : (c))

View File

@ -25,7 +25,7 @@ double PTfudge_factor;
double
PTabs(double arg)
{
return arg >= 0.0 ? arg : -arg;
return fabs(arg);
}
double