aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs/mathutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/stubs/mathutil.h')
-rw-r--r--src/google/protobuf/stubs/mathutil.h23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/google/protobuf/stubs/mathutil.h b/src/google/protobuf/stubs/mathutil.h
index 27956a8e..8a9f69a0 100644
--- a/src/google/protobuf/stubs/mathutil.h
+++ b/src/google/protobuf/stubs/mathutil.h
@@ -41,27 +41,6 @@ namespace google {
namespace protobuf {
namespace internal {
template<typename T>
-bool IsNan(T value) {
- return false;
-}
-template<>
-inline bool IsNan(float value) {
-#ifdef _MSC_VER
- return _isnan(value);
-#else
- return isnan(value);
-#endif
-}
-template<>
-inline bool IsNan(double value) {
-#ifdef _MSC_VER
- return _isnan(value);
-#else
- return isnan(value);
-#endif
-}
-
-template<typename T>
bool AlmostEquals(T a, T b) {
return a == b;
}
@@ -80,7 +59,7 @@ class MathUtil {
public:
template<typename T>
static T Sign(T value) {
- if (value == T(0) || ::google::protobuf::internal::IsNan<T>(value)) {
+ if (value == T(0) || MathLimits<T>::IsNaN(value)) {
return value;
}
return value > T(0) ? 1 : -1;