| Index: base/float_util.h
|
| diff --git a/base/float_util.h b/base/float_util.h
|
| index 458e85965b29657bf4044837c4cd1c88263d5d98..90273106cd65193dbef7edeba2825e1c040adabb 100644
|
| --- a/base/float_util.h
|
| +++ b/base/float_util.h
|
| @@ -13,7 +13,8 @@
|
|
|
| namespace base {
|
|
|
| -inline bool IsFinite(const double& number) {
|
| +template <typename Float>
|
| +inline bool IsFinite(const Float& number) {
|
| #if defined(OS_POSIX)
|
| return std::isfinite(number) != 0;
|
| #elif defined(OS_WIN)
|
| @@ -21,6 +22,15 @@ inline bool IsFinite(const double& number) {
|
| #endif
|
| }
|
|
|
| +template <typename Float>
|
| +inline bool IsNaN(const Float& number) {
|
| +#if defined(OS_POSIX)
|
| + return std::isnan(number) != 0;
|
| +#elif defined(OS_WIN)
|
| + return _isnan(number) != 0;
|
| +#endif
|
| +}
|
| +
|
| } // namespace base
|
|
|
| #endif // BASE_FLOAT_UTIL_H_
|
|
|