forked from mirrors/gecko-dev
Bug 1660405 - Transform mozilla::IsNegative to use std implementation. r=glandium
Since we cannot move away from mozilla::IsNegative to std::signbit because the first one doesn't accept a NaN we should transform our function to use std implementation. Differential Revision: https://phabricator.services.mozilla.com/D173111
This commit is contained in:
parent
e6c033fea4
commit
3fd4d5f938
1 changed files with 1 additions and 6 deletions
|
|
@ -162,12 +162,7 @@ struct FloatingPoint final : private detail::FloatingPointTrait<T> {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static MOZ_ALWAYS_INLINE bool IsNegative(T aValue) {
|
static MOZ_ALWAYS_INLINE bool IsNegative(T aValue) {
|
||||||
MOZ_ASSERT(!std::isnan(aValue), "NaN does not have a sign");
|
MOZ_ASSERT(!std::isnan(aValue), "NaN does not have a sign");
|
||||||
|
return std::signbit(aValue);
|
||||||
/* The sign bit is set if the double is negative. */
|
|
||||||
typedef FloatingPoint<T> Traits;
|
|
||||||
typedef typename Traits::Bits Bits;
|
|
||||||
Bits bits = BitwiseCast<Bits>(aValue);
|
|
||||||
return (bits & Traits::kSignBit) != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Determines whether a float/double represents -0. */
|
/** Determines whether a float/double represents -0. */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue