license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
mmentovai@google.com | 8dcf71c | 2008-08-08 02:15:41 +0900 | [diff] [blame] | 4 | |
| 5 | #ifndef BASE_FLOAT_UTIL_H_ |
| 6 | #define BASE_FLOAT_UTIL_H_ |
| 7 | |
| 8 | #include "build/build_config.h" |
| 9 | |
| 10 | #include <float.h> |
| 11 | #include <math.h> |
| 12 | |
| 13 | namespace base { |
| 14 | |
| 15 | inline bool IsFinite(const double& number) { |
| 16 | #if defined(OS_POSIX) |
| 17 | return finite(number) != 0; |
| 18 | #elif defined(OS_WIN) |
| 19 | return _finite(number) != 0; |
| 20 | #endif |
| 21 | } |
| 22 | |
| 23 | } // namespace base |
| 24 | |
| 25 | #endif // BASE_FLOAT_UTIL_H_ |
license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 26 | |