Roll skia to r1241.
[chromium-blink-merge.git] / base / float_util.h
blob69334d09bf1749d10b4c53bb7a03ecd4f54ae92c
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.
5 #ifndef BASE_FLOAT_UTIL_H_
6 #define BASE_FLOAT_UTIL_H_
7 #pragma once
9 #include "build/build_config.h"
11 #include <float.h>
12 #include <math.h>
14 #if defined(OS_SOLARIS)
15 #include <ieeefp.h>
16 #endif
18 namespace base {
20 inline bool IsFinite(const double& number) {
21 #if defined(OS_POSIX)
22 return finite(number) != 0;
23 #elif defined(OS_WIN)
24 return _finite(number) != 0;
25 #endif
28 } // namespace base
30 #endif // BASE_FLOAT_UTIL_H_