aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs/mathutil.h
diff options
context:
space:
mode:
authorGravatar Adam Cozzette <acozzette@google.com>2016-11-17 16:48:38 -0800
committerGravatar Adam Cozzette <acozzette@google.com>2016-11-17 16:59:59 -0800
commit5a76e633ea9b5adb215e93fdc11e1c0c08b3fc74 (patch)
tree0276f81f8848a05d84cd7e287b43d665e30f04e3 /src/google/protobuf/stubs/mathutil.h
parente28286fa05d8327fd6c5aa70cfb3be558f0932b8 (diff)
Integrated internal changes from Google
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;