1/* $Id: CoinFinite.hpp 1448 2011-06-19 15:34:41Z stefan $ */
2// Copyright (C) 2002, International Business Machines
3// Corporation and others. All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6/* Defines COIN_DBL_MAX and relatives and provides CoinFinite and CoinIsnan. */
7
8#ifndef CoinFinite_H
9#define CoinFinite_H
10
11#include <limits>
12
13//=============================================================================
14// Smallest positive double value and Plus infinity (double and int)
15
16#if 1
17const double COIN_DBL_MIN = std::numeric_limits<double>::min();
18const double COIN_DBL_MAX = std::numeric_limits<double>::max();
19const int COIN_INT_MAX = std::numeric_limits<int>::max();
20const double COIN_INT_MAX_AS_DOUBLE = std::numeric_limits<int>::max();
21#else
22#define COIN_DBL_MIN (std::numeric_limits<double>::min())
23#define COIN_DBL_MAX (std::numeric_limits<double>::max())
24#define COIN_INT_MAX (std::numeric_limits<int>::max())
25#define COIN_INT_MAX_AS_DOUBLE (std::numeric_limits<int>::max())
26#endif
27
28/** checks if a double value is finite (not infinity and not NaN) */
29extern bool CoinFinite(double val);
30
31/** checks if a double value is not a number */
32extern bool CoinIsnan(double val);
33
34#endif
35