security/sandbox/chromium/base/float_util.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Copyright (c) 2012 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_
     8 #include "build/build_config.h"
    10 #include <float.h>
    12 #include <cmath>
    14 namespace base {
    16 template <typename Float>
    17 inline bool IsFinite(const Float& number) {
    18 #if defined(OS_POSIX)
    19   return std::isfinite(number) != 0;
    20 #elif defined(OS_WIN)
    21   return _finite(number) != 0;
    22 #endif
    23 }
    25 template <typename Float>
    26 inline bool IsNaN(const Float& number) {
    27 #if defined(OS_POSIX)
    28   return std::isnan(number) != 0;
    29 #elif defined(OS_WIN)
    30   return _isnan(number) != 0;
    31 #endif
    32 }
    34 }  // namespace base
    36 #endif  // BASE_FLOAT_UTIL_H_

mercurial