tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
numeric_limits.h
Go to the documentation of this file.
1#pragma once
2
16template <typename T>
18
20template <>
21struct 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
28template <>
29struct 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
36template <>
37struct NumericLimits<int>
38{
39 static constexpr int max() noexcept { return __INT_MAX__; }
40 static constexpr int lowest() noexcept { return -__INT_MAX__ - 1; }
41};
42
43template <>
44struct NumericLimits<long>
45{
46 static constexpr long max() noexcept { return __LONG_MAX__; }
47 static constexpr long lowest() noexcept { return -__LONG_MAX__ - 1L; }
48};
49
50template <>
51struct 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
BinaryExpr< LHS, RHS, Max > max(const BaseExpr< LHS > &lhs, const BaseExpr< RHS > &rhs)
Definition minmax.h:38
Compile-time numeric limits for a given type.
Definition numeric_limits.h:17