Itasca C++ Interface
common
base
src
limit.h
Go to the documentation of this file.
1
#pragma once
2
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
24
template
<
class
T>
25
class
limits
:
public
std::numeric_limits<T> {
26
public
:
31
static
T
real_min
() {
32
T min_val =
limits<T>::is_integer
? (
limits<T>::is_signed
?
limits<T>::min
() : 0) : -
limits<T>::max
();
33
return
min_val;
34
}
35
};
36
template
<
class
T>
37
constexpr T initVal() {
return
limits<T>::max
(); }
38
template
<>
39
constexpr
double
initVal<double>() {
return
limits<double>::quiet_NaN
(); }
40
template
<>
41
constexpr
float
initVal<float>() {
return
limits<float>::quiet_NaN
(); }
42
43
44
#ifdef _WIN32
45
# pragma warning(default:4146)
46
#endif
47
49
// EoF
limits::real_min
static T real_min()
Definition:
limit.h:31
limits
debug checked shorthand for std::numeric_limits<T>::
Definition:
limit.h:25
basedef.h
Base type definitions - if QT is not in use.
Generated by
1.8.15