Commit 3fd4d5f9 authored by Andi-Bogdan Postelnicu's avatar Andi-Bogdan Postelnicu
Browse files

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
parent e6c033fe
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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. */