michael@0: // Copyright (c) 2012 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef BASE_FLOAT_UTIL_H_ michael@0: #define BASE_FLOAT_UTIL_H_ michael@0: michael@0: #include "build/build_config.h" michael@0: michael@0: #include michael@0: michael@0: #include michael@0: michael@0: namespace base { michael@0: michael@0: template michael@0: inline bool IsFinite(const Float& number) { michael@0: #if defined(OS_POSIX) michael@0: return std::isfinite(number) != 0; michael@0: #elif defined(OS_WIN) michael@0: return _finite(number) != 0; michael@0: #endif michael@0: } michael@0: michael@0: template michael@0: inline bool IsNaN(const Float& number) { michael@0: #if defined(OS_POSIX) michael@0: return std::isnan(number) != 0; michael@0: #elif defined(OS_WIN) michael@0: return _isnan(number) != 0; michael@0: #endif michael@0: } michael@0: michael@0: } // namespace base michael@0: michael@0: #endif // BASE_FLOAT_UTIL_H_