Itasca C++ Interface
Loading...
Searching...
No Matches
limit.h
Go to the documentation of this file.
1#pragma once
7#include "basedef.h"
8#include <limits>
9
10#ifdef _WIN32
11# pragma warning(disable:4146)
12#endif
13
14#ifdef __LINUX
15#include <math.h>
16#endif
17
24template <class T>
25class limits : public std::numeric_limits<T> {
26public:
31 static T real_min() {
33 return min_val;
34 }
35};
36template <class T>
37constexpr T initVal() { return limits<T>::max(); }
38template <>
39constexpr double initVal<double>() { return std::numeric_limits<double>::quiet_NaN(); }
40template <>
41constexpr float initVal<float>() { return std::numeric_limits<float>::quiet_NaN(); }
42
43
44#ifdef _WIN32
45# pragma warning(default:4146)
46#endif
47
49// EoF
Base type definitions for the engine.
debug checked shorthand for std::numeric_limits<T>::
Definition limit.h:25
static T real_min()
Definition limit.h:31