Update test of numext::signbit.
diff --git a/test/numext.cpp b/test/numext.cpp
index 5483e5c..e99eddc 100644
--- a/test/numext.cpp
+++ b/test/numext.cpp
@@ -239,19 +239,6 @@
   check_rsqrt_impl<T>::run();
 }
 
-template <typename T, bool IsInteger = NumTraits<T>::IsInteger>
-struct ref_signbit_func_impl {
-  static bool run(const T& x) { return std::signbit(x); }
-};
-template <typename T>
-struct ref_signbit_func_impl<T, true> {
-  // MSVC (perhaps others) does not have a std::signbit overload for integers
-  static bool run(const T& x) { return x < T(0); }
-};
-template <typename T>
-bool ref_signbit_func(const T& x) {
-  return ref_signbit_func_impl<T>::run(x);
-}
 
 template <typename T>
 struct check_signbit_impl {
@@ -261,28 +248,46 @@
     T false_mask;
     std::memset(static_cast<void*>(&false_mask), 0x00, sizeof(T));
 
-    // has sign bit
-    const T neg_zero = static_cast<T>(-0.0);
-    const T neg_one = static_cast<T>(-1.0);
-    const T neg_inf = -std::numeric_limits<T>::infinity();
-    const T neg_nan = -std::numeric_limits<T>::quiet_NaN();
-    // does not have sign bit
-    const T pos_zero = static_cast<T>(0.0);
-    const T pos_one = static_cast<T>(1.0);
-    const T pos_inf = std::numeric_limits<T>::infinity();
-    const T pos_nan = std::numeric_limits<T>::quiet_NaN();
+    std::vector<T> negative_values;
+    std::vector<T> non_negative_values;
 
-    std::vector<T> values = {neg_zero, neg_one, neg_inf, neg_nan, pos_zero, pos_one, pos_inf, pos_nan};
-
-    bool all_pass = true;
-
-    for (T val : values) {
-      const T numext_val = numext::signbit(val);
-      const T ref_val = ref_signbit_func(val) ? true_mask : false_mask;
-      bool not_same = internal::predux_any(internal::bitwise_helper<T>::bitwise_xor(ref_val, numext_val));
-      all_pass = all_pass && !not_same;
-      if (not_same) std::cout << "signbit(" << val << ") != " << numext_val << "\n";
+    if (NumTraits<T>::IsInteger) {
+      negative_values = {static_cast<T>(-1),
+        static_cast<T>(NumTraits<T>::lowest())};
+      non_negative_values = {static_cast<T>(0), static_cast<T>(1),
+        static_cast<T>(NumTraits<T>::highest())};
+    } else {
+      // has sign bit
+      const T neg_zero = static_cast<T>(-0.0);
+      const T neg_one = static_cast<T>(-1.0);
+      const T neg_inf = -std::numeric_limits<T>::infinity();
+      const T neg_nan = -std::numeric_limits<T>::quiet_NaN();
+      // does not have sign bit
+      const T pos_zero = static_cast<T>(0.0);
+      const T pos_one = static_cast<T>(1.0);
+      const T pos_inf = std::numeric_limits<T>::infinity();
+      const T pos_nan = std::numeric_limits<T>::quiet_NaN();
+      negative_values = {neg_zero, neg_one, neg_inf, neg_nan};
+      non_negative_values = {pos_zero, pos_one, pos_inf, pos_nan};
     }
+
+
+    auto check_all = [](auto values, auto expected) {
+      bool all_pass = true;
+      for (T val : values) {
+        const T numext_val = numext::signbit(val);
+        bool not_same = internal::predux_any(
+            internal::bitwise_helper<T>::bitwise_xor(expected, numext_val));
+        all_pass = all_pass && !not_same;
+        if (not_same)
+          std::cout << "signbit(" << val << ") = " << numext_val
+                    << " != " << expected << std::endl;
+      }
+      return all_pass;
+    };
+
+    bool all_pass = check_all(non_negative_values, false_mask);
+    all_pass = all_pass && check_all(negative_values, (NumTraits<T>::IsSigned ? true_mask : false_mask));
     VERIFY(all_pass);
   }
 };
@@ -318,7 +323,7 @@
     CALL_SUBTEST( check_sqrt<double>() );
     CALL_SUBTEST( check_sqrt<std::complex<float> >() );
     CALL_SUBTEST( check_sqrt<std::complex<double> >() );
-    
+
     CALL_SUBTEST( check_rsqrt<float>() );
     CALL_SUBTEST( check_rsqrt<double>() );
     CALL_SUBTEST( check_rsqrt<std::complex<float> >() );