diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 22:41:16 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 22:41:16 +0000 |
commit | 7fe73a7231945d4e5f6f4b27ad3b6dfa3a019336 (patch) | |
tree | e5636961deb018b7ff585ebf840f1fdbe7f73227 /base/float_util.h | |
parent | d9b7dabc9475e1e8a9718c59ffb4e7544d2ff0d6 (diff) | |
download | chromium_src-7fe73a7231945d4e5f6f4b27ad3b6dfa3a019336.zip chromium_src-7fe73a7231945d4e5f6f4b27ad3b6dfa3a019336.tar.gz chromium_src-7fe73a7231945d4e5f6f4b27ad3b6dfa3a019336.tar.bz2 |
Use std::isfinite().
More standards-comformant, also needed for C++11 on Linux.
BUG=233330
Review URL: https://codereview.chromium.org/14188028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/float_util.h')
-rw-r--r-- | base/float_util.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/base/float_util.h b/base/float_util.h index 31a307d..458e859 100644 --- a/base/float_util.h +++ b/base/float_util.h @@ -8,16 +8,14 @@ #include "build/build_config.h" #include <float.h> -#include <math.h> + +#include <cmath> namespace base { inline bool IsFinite(const double& number) { -#if defined(OS_ANDROID) - // isfinite isn't available on Android: http://b.android.com/34793 - return finite(number) != 0; -#elif defined(OS_POSIX) - return isfinite(number) != 0; +#if defined(OS_POSIX) + return std::isfinite(number) != 0; #elif defined(OS_WIN) return _finite(number) != 0; #endif |