mirror of
https://github.com/fmtlib/fmt.git
synced 2026-02-13 21:59:57 +08:00
Fix signbit detection (#423)
(cherry picked from commit def687462c32ec40757e49eb6069f109d50236d6)
This commit is contained in:
parent
b9a20d761a
commit
baedba07ca
@ -397,8 +397,10 @@ class numeric_limits<fmt::internal::DummyInt> :
|
|||||||
// Portable version of signbit.
|
// Portable version of signbit.
|
||||||
static bool isnegative(double x) {
|
static bool isnegative(double x) {
|
||||||
using namespace fmt::internal;
|
using namespace fmt::internal;
|
||||||
if (const_check(sizeof(signbit(x)) == sizeof(int)))
|
if (const_check(sizeof(signbit(x)) == sizeof(bool) ||
|
||||||
|
sizeof(signbit(x)) == sizeof(int))) {
|
||||||
return signbit(x) != 0;
|
return signbit(x) != 0;
|
||||||
|
}
|
||||||
if (x < 0) return true;
|
if (x < 0) return true;
|
||||||
if (!isnotanumber(x)) return false;
|
if (!isnotanumber(x)) return false;
|
||||||
int dec = 0, sign = 0;
|
int dec = 0, sign = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user