Itasca C++ Interface
Toggle main menu visibility
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
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
std::numeric_limits<double>::quiet_NaN(); }
40
template
<>
41
constexpr
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
basedef.h
Base type definitions for the engine.
limits
debug checked shorthand for std::numeric_limits<T>::
Definition
limit.h:25
limits::real_min
static T real_min()
Definition
limit.h:31
common
base
src
limit.h
Generated by
1.18.0