зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
e6c033fea4
Коммит
3fd4d5f938
|
@ -162,12 +162,7 @@ struct FloatingPoint final : private detail::FloatingPointTrait<T> {
|
|||
template <typename T>
|
||||
static MOZ_ALWAYS_INLINE bool IsNegative(T aValue) {
|
||||
MOZ_ASSERT(!std::isnan(aValue), "NaN does not have a sign");
|
||||
|
||||
/* 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;
|
||||
return std::signbit(aValue);
|
||||
}
|
||||
|
||||
/** Determines whether a float/double represents -0. */
|
||||
|
|
Загрузка…
Ссылка в новой задаче