signbit() returns nonzero for negative arguments, but we shouldn't assume
that it always returns the same nonzero value.
This commit is contained in:
parent
4a09b0df94
commit
cf37ce3724
@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$");
|
||||
int
|
||||
fpequal(long double x, long double y)
|
||||
{
|
||||
return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y));
|
||||
return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -85,7 +85,8 @@ int
|
||||
fpequal(long double x, long double y)
|
||||
{
|
||||
|
||||
return ((x == y && signbit(x) == signbit(y)) || (isnan(x) && isnan(y)));
|
||||
return ((x == y && !signbit(x) == !signbit(y))
|
||||
|| (isnan(x) && isnan(y)));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -50,7 +50,8 @@ static inline int
|
||||
fpequal(long double x, long double y)
|
||||
{
|
||||
|
||||
return ((x == y && signbit(x) == signbit(y)) || (isnan(x) && isnan(y)));
|
||||
return ((x == y && !signbit(x) == !signbit(y))
|
||||
|| (isnan(x) && isnan(y)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -118,7 +118,7 @@ fpequal(long double x, long double y, long double tol)
|
||||
|
||||
if (isnan(x) && isnan(y))
|
||||
return (1);
|
||||
if (signbit(x) != signbit(y))
|
||||
if (!signbit(x) != !signbit(y))
|
||||
return (0);
|
||||
if (x == y)
|
||||
return (1);
|
||||
|
@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$");
|
||||
int
|
||||
fpequal(long double x, long double y)
|
||||
{
|
||||
return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y));
|
||||
return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$");
|
||||
int
|
||||
fpequal(long double x, long double y)
|
||||
{
|
||||
return ((x == y && signbit(x) == signbit(y)) || isnan(x) && isnan(y));
|
||||
return ((x == y && !signbit(x) == !signbit(y)) || isnan(x) && isnan(y));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user