tesseract++
0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
core
include
numeric_limits.h
Go to the documentation of this file.
1
#pragma once
2
16
template
<
typename
T>
17
struct
NumericLimits
;
18
20
template
<>
21
struct
NumericLimits
<float>
22
{
23
static
constexpr
float
max
() noexcept {
return
__FLT_MAX__; }
24
static
constexpr
float
lowest() noexcept {
return
-__FLT_MAX__; }
25
static
constexpr
float
infinity() noexcept {
return
__builtin_huge_valf(); }
26
};
27
28
template
<>
29
struct
NumericLimits
<double>
30
{
31
static
constexpr
double
max
() noexcept {
return
__DBL_MAX__; }
32
static
constexpr
double
lowest() noexcept {
return
-__DBL_MAX__; }
33
static
constexpr
double
infinity() noexcept {
return
__builtin_huge_val(); }
34
};
35
36
template
<>
37
struct
NumericLimits
<int>
38
{
39
static
constexpr
int
max
() noexcept {
return
__INT_MAX__; }
40
static
constexpr
int
lowest() noexcept {
return
-__INT_MAX__ - 1; }
41
};
42
43
template
<>
44
struct
NumericLimits
<long>
45
{
46
static
constexpr
long
max
() noexcept {
return
__LONG_MAX__; }
47
static
constexpr
long
lowest() noexcept {
return
-__LONG_MAX__ - 1L; }
48
};
49
50
template
<>
51
struct
NumericLimits
<unsigned int>
52
{
53
static
constexpr
unsigned
int
max
() noexcept {
return
__INT_MAX__ * 2U + 1U; }
54
static
constexpr
unsigned
int
lowest() noexcept {
return
0; }
55
};
56
max
BinaryExpr< LHS, RHS, Max > max(const BaseExpr< LHS > &lhs, const BaseExpr< RHS > &rhs)
Definition
minmax.h:38
NumericLimits
Compile-time numeric limits for a given type.
Definition
numeric_limits.h:17
Generated by
1.9.8