Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
numeric_limits.hpp
Go to the documentation of this file.
1// Copyright 2026, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_NUMERIC_LIMITS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_NUMERIC_LIMITS_HPP_
7
8// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
9// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
10// parasoft-begin-suppress AUTOSAR-A7_1_5-a-2 "Trailing return syntax permitted by A7-1-5 Permit #1 v1.0.0"
11
12// parasoft-begin-suppress AUTOSAR-A3_9_1-b "The C++ standard explicitly specifies the use of int"
13// parasoft-begin-suppress AUTOSAR-M11_0_1-a "The C++ standard explicitly specifies that members are public"
14
15// IWYU pragma: private, include <limits>
16// IWYU pragma: friend "stdlib_detail/.*"
17
18// parasoft-begin-suppress AUTOSAR-A18_0_1-a-2 "The C++ headers are not available"
19// parasoft-begin-suppress AUTOSAR-A1_1_1-d-2 "The C++ headers are not available"
20// NOLINTNEXTLINE(hicpp-deprecated-headers)
21#include <float.h>
22// NOLINTNEXTLINE(hicpp-deprecated-headers)
23#include <limits.h>
24// parasoft-end-suppress AUTOSAR-A1_1_1-d-2
25// parasoft-end-suppress AUTOSAR-A18_0_1-a-2
26
27#include "arene/base/constraints.hpp"
28#include "stdlib/include/stdlib_detail/cstdint.hpp"
29#include "stdlib/include/stdlib_detail/enable_if.hpp"
30#include "stdlib/include/stdlib_detail/is_signed.hpp"
31
32// parasoft-begin-suppress AUTOSAR-A16_0_1-a "Preprocessor used to prevent compilation in unsupported configurations"
33// parasoft-begin-suppress AUTOSAR-A16_6_1-a "Preprocessor used to prevent compilation in unsupported configurations"
34// parasoft-begin-suppress AUTOSAR-A16_0_1-b "Preprocessor used to prevent compilation in unsupported configurations"
35#if defined(__FAST_MATH__)
36#error "Fast math not supported as does not conform to IEC559"
37#endif
38
39// parasoft-begin-suppress AUTOSAR-M16_0_7-a "Macro only checked if defined"
40#if defined(__FINITE_MATH_ONLY__) && (__FINITE_MATH_ONLY__ == 1)
41#error "Finite math only not supported does not conform to IEC559"
42#endif
43// parasoft-end-suppress AUTOSAR-M16_0_7-a
44
45// parasoft-begin-suppress AUTOSAR-M16_0_7-a "Macro only checked if defined"
46#if defined(__NO_TRAPPING_MATH__) && (__NO_TRAPPING_MATH__ == 1)
47#error "Disabling trapping math not supported as it does not conform to IEC559"
48#endif
49// parasoft-end-suppress AUTOSAR-M16_0_7-a
50
51// parasoft-begin-suppress AUTOSAR-M16_0_7-a "Macro only checked if defined"
52#if defined(__GCC_IEC_559) && (__GCC_IEC_559 == 0)
53#error "Unsupported floating point mode that does not conform to IEC559 enabled"
54#endif
55// parasoft-end-suppress AUTOSAR-M16_0_7-a
56// parasoft-end-suppress AUTOSAR-A16_0_1-a
57// parasoft-end-suppress AUTOSAR-A16_6_1-a
58// parasoft-end-suppress AUTOSAR-A16_0_1-b
59
60namespace std {
61
62// NOLINTNEXTLINE(readability-magic-numbers)
63static_assert(CHAR_BIT == 8, "Values only correct for platforms with 8-bit bytes");
64
65// parasoft-begin-suppress AUTOSAR-A7_2_3-a "Specified as a non-scoped enum in the C++ standard"
66/// @brief Enumeration describing possible rounding styles
68 /// @brief Rounding is indeterminable
70 /// @brief Round towards zero
72 /// @brief Round towards nearest
74 /// @brief Round towards positive infinity
76 /// @brief Round towards negative infinity
78};
79// parasoft-end-suppress AUTOSAR-A7_2_3-a
80
81// parasoft-begin-suppress AUTOSAR-A7_2_3-a "Specified as a non-scoped enum in the C++ standard"
82/// @brief Enumeration describing possible denormalized value representation properties
84 /// @brief It cannot be determined if this type has denormalized values
86 /// @brief This type has no denormalized values
88 /// @brief This type has denormalized values
90};
91// parasoft-end-suppress AUTOSAR-A7_2_3-a
92
94
95/// @brief Internal helper to define properties for integer types
96template <std::size_t>
97struct int_info;
98
99/// @brief Internal helper to define properties for 1-byte integer types
100template <>
101struct int_info<1> {
102 /// @brief The number of decimal digits
103 static constexpr int digits10{2};
104 /// @brief The number of decimal digits when unsigned
105 static constexpr int unsigned_digits10{2};
106 /// @brief The minimum value of a signed integer with this size
107 static constexpr int8_t signed_min{-128};
108 /// @brief The maximum value of a signed integer with this size
109 static constexpr int8_t signed_max{127};
110 /// @brief The maximum value of an unsigned integer with this size
111 static constexpr uint8_t unsigned_max{255U};
112};
113
114/// @brief Internal helper to define properties for 2-byte integer types
115template <>
116struct int_info<2> {
117 /// @brief The number of decimal digits
118 static constexpr int digits10{4};
119 /// @brief The number of decimal digits when unsigned
120 static constexpr int unsigned_digits10{4};
121 /// @brief The minimum value of a signed integer with this size
122 static constexpr int16_t signed_min{-32768};
123 /// @brief The minimum value of a signed integer with this size
124 static constexpr int16_t signed_max{32767};
125 /// @brief The maximum value of an unsigned integer with this size
126 static constexpr uint16_t unsigned_max{65535U};
127};
128
129/// @brief Internal helper to define properties for 4-byte integer types
130template <>
131struct int_info<4> {
132 /// @brief The number of decimal digits
133 static constexpr int digits10{9};
134 /// @brief The number of decimal digits when unsigned
135 static constexpr int unsigned_digits10{9};
136 // parasoft-begin-suppress CERT_C-STR34-b "False positive: No char types used here"
137 /// @brief The maximum value of a signed integer with this size
138 static constexpr int32_t signed_max{static_cast<int32_t>(2'147'483'647L)};
139 // parasoft-end-suppress CERT_C-STR34-b
140 /// @brief The minimum value of a signed integer with this size
141 static constexpr int32_t signed_min{static_cast<int32_t>(-signed_max - 1)};
142 /// @brief The maximum value of an unsigned integer with this size
143 static constexpr uint32_t unsigned_max{static_cast<uint32_t>(4'294'967'295U)};
144};
145
146/// @brief Internal helper to define properties for 8-byte integer types
147template <>
148// NOLINTNEXTLINE(readability-magic-numbers)
149struct int_info<8> {
150 /// @brief The number of decimal digits
151 static constexpr int digits10{18};
152 /// @brief The number of decimal digits when unsigned
153 static constexpr int unsigned_digits10{19};
154 // parasoft-begin-suppress CERT_C-STR34-b "False positive: No char types used here"
155 /// @brief The maximum value of a signed integer with this size
156 static constexpr int64_t signed_max{static_cast<int64_t>(9'223'372'036'854'775'807LL)};
157 // parasoft-end-suppress CERT_C-STR34-b
158 /// @brief The minimum value of a signed integer with this size
159 static constexpr int64_t signed_min{-signed_max - static_cast<int64_t>(1)};
160 /// @brief The maximum value of an unsigned integer with this size
161 static constexpr uint64_t unsigned_max{static_cast<uint64_t>(18'446'744'073'709'551'615ULL)};
162};
163
164/// @brief Implementation template for @c numeric_limits
165/// @tparam T The type being checked
166template <typename T, typename = arene::base::constraints<>>
168 public:
169 /// @brief Is this a specialization for which the other values are meaningful? @c true if so, @c false otherwise
170 static constexpr bool is_specialized{false};
171 /// @brief Is the type an integral type? @c true if so, @c false otherwise
172 static constexpr bool is_integer{false};
173 /// @brief Is the type an exact type? @c true if so, @c false otherwise
174 static constexpr bool is_exact{false};
175 /// @brief Is the type a signed type? @c true if so, @c false otherwise
176 static constexpr bool is_signed{false};
177 /// @brief The base used for the representation.
178 static constexpr int radix{0};
179 /// @brief The number of @c radix digits in the representation, ignoring any sign bit
180 static constexpr int digits{0};
181 /// @brief The maximum number of base-10 digits that can be completely represented in values of the type
182 static constexpr int digits10{0};
183 /// @brief @c true if the set of values representable by the type is bounded, otherwise @c false
184 static constexpr bool is_bounded{false};
185 /// @brief @c true if the set of values representable by the type is modulo, otherwise @c false
186 static constexpr bool is_modulo{false};
187 /// @brief @c true if there are trap representations of this type, otherwise @c false
188 static constexpr bool traps{false};
189
190 /// @brief For floating point types, the number of base-10 digits required to ensure that values which differ can be
191 /// differentiated
192 static constexpr int max_digits10{0};
193 /// @brief For floating point types, the minimum negative integer such that @c radix raised to the power of one less
194 /// than that integer is a normalized floating point number.
195 static constexpr int min_exponent{0};
196 /// @brief For floating point types, the minimum negative integer such that 10 raised to the power of one less than
197 /// that integer is in the range of normalized floating point numbers.
198 static constexpr int min_exponent10{0};
199 /// @brief For floating point types, the maximum positive integer such that @c radix raised to the power of one less
200 /// than that integer is a representable finite floating point number.
201 static constexpr int max_exponent{0};
202 /// @brief For floating point types, the maximum positive integer such that 10 raised to the power of one less than
203 /// that integer is in the range of representable finite floating point numbers.
204 static constexpr int max_exponent10{0};
205 /// @brief For floating point types, @c true if the type has a representation of positive infinity, otherwise @c false
206 static constexpr bool has_infinity{false};
207 /// @brief For floating point types, @c true if the type has a representation of a quiet (non-signaling)
208 /// "Not-a-Number", otherwise @c false
209 // NOLINTNEXTLINE(readability-identifier-naming)
210 static constexpr bool has_quiet_NaN{false};
211 /// @brief For floating point types, @c true if the type has a representation of a signaling "Not-a-Number", otherwise
212 /// @c false
213 // NOLINTNEXTLINE(readability-identifier-naming)
214 static constexpr bool has_signaling_NaN{false};
215 /// @brief For floating point types, an indicator of whether the type has a representation of denormalized values
217 /// @brief For floating point types, @c true if loss of accuracy is detected as a denormalization loss rather than an
218 /// inexact result, otherwise @c false
219 static constexpr bool has_denorm_loss{false};
220 /// @brief For floating point types, @c true if the type adheres to the IEC559 standard, otherwise @c false
221 static constexpr bool is_iec559{false};
222 /// @brief For floating point types, @c true if tinyness is detected before rounding, otherwise @c false
223 static constexpr bool tinyness_before{false};
224 /// @brief For floating point types, an indicator of the default rounding style
226
227 /// @brief The maximum finite value
228 /// @return The maximum value
229 // parasoft-begin-suppress AUTOSAR-A5_2_2-a "False positive: No C-style cast is used"
230 static constexpr auto max() noexcept -> T { return T(); }
231 // parasoft-end-suppress AUTOSAR-A5_2_2-a
232
233 /// @brief The minimum finite value; the minimum positive normalized value for floating point types
234 /// @return The minimum value
235 static constexpr auto min() noexcept -> T { return T(); }
236 /// @brief The minimum finite value such that there is no finite value @c y such that @c y<lowest()
237 /// @return The minimum value
238 static constexpr auto lowest() noexcept -> T { return T(); }
239
240 /// @brief For floating point types, the epsilon value: the difference between 1 and the least representable value
241 /// greater than 1
242 /// @return The epsilon value
243 static constexpr auto epsilon() noexcept -> T { return T(); }
244 /// @brief For floating point types, the maximum rounding error
245 /// @return The maximum rounding error
246 static constexpr auto round_error() noexcept -> T { return T(); }
247 /// @brief For floating point types where @c has_infinity is @c true, a representation of positive infinity
248 /// @return Positive infinity
249 static constexpr auto infinity() noexcept -> T { return T(); }
250 /// @brief For floating point types where @c has_quiet_NaN is @c true, a representation of a quiet NaN
251 /// @return A quiet NaN value
252 // NOLINTNEXTLINE(readability-identifier-naming)
253 static constexpr auto quiet_NaN() noexcept -> T { return T(); }
254 /// @brief For floating point types where @c has_signaling_NaN is @c true, a representation of a signaling NaN
255 /// @return A signaling NaN value
256 // NOLINTNEXTLINE(readability-identifier-naming)
257 static constexpr auto signaling_NaN() noexcept -> T { return T(); }
258 /// @brief For floating point types, the minimum positive denormalized value. If the representation has no
259 /// denormalized values, the minimum positive normalized value.
260 /// @return The minimum positive denormalized value
261 static constexpr auto denorm_min() noexcept -> T { return T(); }
262};
263
264/// @brief Specialization of the implementation template for @c numeric_limits for integral types
265/// @tparam T The type being checked
266template <typename T>
268 public:
269 /// @brief Is this a specialization for which the other values are meaningful? @c true if so, @c false otherwise
270 static constexpr bool is_specialized{true};
271 /// @brief Is the type an integral type? @c true if so, @c false otherwise
272 static constexpr bool is_integer{true};
273 /// @brief Is the type an exact type? @c true if so, @c false otherwise
274 static constexpr bool is_exact{true};
275 // parasoft-begin-suppress AUTOSAR-A3_3_2-a "False positive: The initializer is constant"
276 // parasoft-begin-suppress CERT_CPP-DCL56-a "False positive: is_signed_v is initialized"
277 /// @brief Is the type a signed type? @c true if so, @c false otherwise
278 static constexpr bool is_signed{is_signed_v<T>};
279 // parasoft-end-suppress CERT_CPP-DCL56-a
280 // parasoft-end-suppress AUTOSAR-A3_3_2-a
281 /// @brief The base used for the representation.
282 static constexpr int radix{2};
283 // parasoft-begin-suppress AUTOSAR-A5_16_1-a "False positive: Conditional operator not used as subexpression"
284 /// @brief The number of @c radix digits in the representation, ignoring any sign bit
285 static constexpr int digits{static_cast<int>(
286 is_signed ? (sizeof(T) * static_cast<unsigned>(CHAR_BIT) - 1U) : (sizeof(T) * static_cast<unsigned>(CHAR_BIT))
287 )};
288 // parasoft-end-suppress AUTOSAR-A5_16_1-a
289 // parasoft-begin-suppress AUTOSAR-A5_16_1-a "False positive: Conditional operator not used as subexpression"
290 /// @brief The maximum number of base-10 digits that can be completely represented in values of the type
291 static constexpr int digits10{is_signed ? int_info<sizeof(T)>::digits10 : int_info<sizeof(T)>::unsigned_digits10};
292 // parasoft-end-suppress AUTOSAR-A5_16_1-a
293 /// @brief @c true if the set of values representable by the type is bounded, otherwise @c false
294 static constexpr bool is_bounded{true};
295 /// @brief @c true if the set of values representable by the type is modulo, otherwise @c false
296 static constexpr bool is_modulo{!is_signed};
297 /// @brief @c true if there are trap representations of this type, otherwise @c false
298 static constexpr bool traps{true};
299
300 /// @brief For floating point types, the number of base-10 digits required to ensure that values which differ can be
301 /// differentiated
302 static constexpr int max_digits10{0};
303 /// @brief For floating point types, the minimum negative integer such that @c radix raised to the power of one less
304 /// than that integer is a normalized floating point number.
305 static constexpr int min_exponent{0};
306 /// @brief For floating point types, the minimum negative integer such that 10 raised to the power of one less than
307 /// that integer is in the range of normalized floating point numbers.
308 static constexpr int min_exponent10{0};
309 /// @brief For floating point types, the maximum positive integer such that @c radix raised to the power of one less
310 /// than that integer is a representable finite floating point number.
311 static constexpr int max_exponent{0};
312 /// @brief For floating point types, the maximum positive integer such that 10 raised to the power of one less than
313 /// that integer is in the range of representable finite floating point numbers.
314 static constexpr int max_exponent10{0};
315 /// @brief For floating point types, @c true if the type has a representation of positive infinity, otherwise @c false
316 static constexpr bool has_infinity{false};
317 /// @brief For floating point types, @c true if the type has a representation of a quiet (non-signaling)
318 /// "Not-a-Number", otherwise @c false
319 // NOLINTNEXTLINE(readability-identifier-naming)
320 static constexpr bool has_quiet_NaN{false};
321 /// @brief For floating point types, @c true if the type has a representation of a signaling "Not-a-Number", otherwise
322 /// @c false
323 // NOLINTNEXTLINE(readability-identifier-naming)
324 static constexpr bool has_signaling_NaN{false};
325 /// @brief For floating point types, an indicator of whether the type has a representation of denormalized values
327 /// @brief For floating point types, @c true if loss of accuracy is detected as a denormalization loss rather than an
328 /// inexact result, otherwise @c false
329 static constexpr bool has_denorm_loss{false};
330 /// @brief For floating point types, @c true if the type adheres to the IEC559 standard, otherwise @c false
331 static constexpr bool is_iec559{false};
332 /// @brief For floating point types, @c true if tinyness is detected before rounding, otherwise @c false
333 static constexpr bool tinyness_before{false};
334 /// @brief For floating point types, an indicator of the default rounding style
336
337 /// @brief The maximum finite value
338 /// @return The maximum value
339 static constexpr auto max() noexcept -> T {
340 return is_signed ? static_cast<T>(int_info<sizeof(T)>::signed_max)
341 : static_cast<T>(int_info<sizeof(T)>::unsigned_max);
342 }
343 /// @brief The minimum finite value; the minimum positive normalized value for floating point types
344 /// @return The minimum value
345 static constexpr auto min() noexcept -> T {
346 return is_signed ? static_cast<T>(int_info<sizeof(T)>::signed_min) : static_cast<T>(0);
347 }
348 /// @brief The minimum finite value such that there is no finite value @c y such that @c y<lowest()
349 /// @return The minimum value
350 static constexpr auto lowest() noexcept -> T { return min(); }
351
352 /// @brief For floating point types, the epsilon value: the difference between 1 and the least representable value
353 /// greater than 1
354 /// @return The epsilon value
355 static constexpr auto epsilon() noexcept -> T { return T{}; }
356 /// @brief For floating point types, the maximum rounding error
357 /// @return The maximum rounding error
358 static constexpr auto round_error() noexcept -> T { return T{}; }
359 /// @brief For floating point types where @c has_infinity is @c true, a representation of positive infinity
360 /// @return Positive infinity
361 static constexpr auto infinity() noexcept -> T { return T{}; }
362 /// @brief For floating point types where @c has_quiet_NaN is @c true, a representation of a quiet NaN
363 /// @return A quiet NaN value
364 // NOLINTNEXTLINE(readability-identifier-naming)
365 static constexpr auto quiet_NaN() noexcept -> T { return T{}; }
366 /// @brief For floating point types where @c has_signaling_NaN is @c true, a representation of a signaling NaN
367 /// @return A signaling NaN value
368 // NOLINTNEXTLINE(readability-identifier-naming)
369 static constexpr auto signaling_NaN() noexcept -> T { return T{}; }
370 /// @brief For floating point types, the minimum positive denormalized value. If the representation has no
371 /// denormalized values, the minimum positive normalized value.
372 /// @return The minimum positive denormalized value
373 static constexpr auto denorm_min() noexcept -> T { return T{}; }
374};
375
376/// @brief Specialization of the implementation template for @c numeric_limits for @c bool
377template <>
379 public:
380 /// @brief Is this a specialization for which the other values are meaningful? @c true if so, @c false otherwise
381 static constexpr bool is_specialized{true};
382 /// @brief Is the type an integral type? @c true if so, @c false otherwise
383 static constexpr bool is_integer{true};
384 /// @brief Is the type an exact type? @c true if so, @c false otherwise
385 static constexpr bool is_exact{true};
386 /// @brief Is the type a signed type? @c true if so, @c false otherwise
387 static constexpr bool is_signed{false};
388 /// @brief The base used for the representation.
389 static constexpr int radix{2};
390 /// @brief The number of @c radix digits in the representation, ignoring any sign bit
391 static constexpr int digits{1};
392 /// @brief The maximum number of base-10 digits that can be completely represented in values of the type
393 static constexpr int digits10{0};
394 /// @brief @c true if the set of values representable by the type is bounded, otherwise @c false
395 static constexpr bool is_bounded{true};
396 /// @brief @c true if the set of values representable by the type is modulo, otherwise @c false
397 static constexpr bool is_modulo{false};
398 /// @brief @c true if there are trap representations of this type, otherwise @c false
399 static constexpr bool traps{false};
400
401 /// @brief For floating point types, the number of base-10 digits required to ensure that values which differ can be
402 /// differentiated
403 static constexpr int max_digits10{0};
404 /// @brief For floating point types, the minimum negative integer such that @c radix raised to the power of one less
405 /// than that integer is a normalized floating point number.
406 static constexpr int min_exponent{0};
407 /// @brief For floating point types, the minimum negative integer such that 10 raised to the power of one less than
408 /// that integer is in the range of normalized floating point numbers.
409 static constexpr int min_exponent10{0};
410 /// @brief For floating point types, the maximum positive integer such that @c radix raised to the power of one less
411 /// than that integer is a representable finite floating point number.
412 static constexpr int max_exponent{0};
413 /// @brief For floating point types, the maximum positive integer such that 10 raised to the power of one less than
414 /// that integer is in the range of representable finite floating point numbers.
415 static constexpr int max_exponent10{0};
416 /// @brief For floating point types, @c true if the type has a representation of positive infinity, otherwise @c false
417 static constexpr bool has_infinity{false};
418 /// @brief For floating point types, @c true if the type has a representation of a quiet (non-signaling)
419 /// "Not-a-Number", otherwise @c false
420 // NOLINTNEXTLINE(readability-identifier-naming)
421 static constexpr bool has_quiet_NaN{false};
422 /// @brief For floating point types, @c true if the type has a representation of a signaling "Not-a-Number", otherwise
423 /// @c false
424 // NOLINTNEXTLINE(readability-identifier-naming)
425 static constexpr bool has_signaling_NaN{false};
426 /// @brief For floating point types, an indicator of whether the type has a representation of denormalized values
428 /// @brief For floating point types, @c true if loss of accuracy is detected as a denormalization loss rather than an
429 /// inexact result, otherwise @c false
430 static constexpr bool has_denorm_loss{false};
431 /// @brief For floating point types, @c true if the type adheres to the IEC559 standard, otherwise @c false
432 static constexpr bool is_iec559{false};
433 /// @brief For floating point types, @c true if tinyness is detected before rounding, otherwise @c false
434 static constexpr bool tinyness_before{false};
435 /// @brief For floating point types, an indicator of the default rounding style
437
438 /// @brief The maximum finite value
439 /// @return The maximum value
440 static constexpr auto max() noexcept -> bool { return true; }
441 /// @brief The minimum finite value; the minimum positive normalized value for floating point types
442 /// @return The minimum value
443 static constexpr auto min() noexcept -> bool { return false; }
444 /// @brief The minimum finite value such that there is no finite value @c y such that @c y<lowest()
445 /// @return The minimum value
446 static constexpr auto lowest() noexcept -> bool { return min(); }
447
448 /// @brief For floating point types, the epsilon value: the difference between 1 and the least representable value
449 /// greater than 1
450 /// @return The epsilon value
451 static constexpr auto epsilon() noexcept -> bool { return false; }
452 /// @brief For floating point types, the maximum rounding error
453 /// @return The maximum rounding error
454 static constexpr auto round_error() noexcept -> bool { return false; }
455 /// @brief For floating point types where @c has_infinity is @c true, a representation of positive infinity
456 /// @return Positive infinity
457 static constexpr auto infinity() noexcept -> bool { return false; }
458 /// @brief For floating point types where @c has_quiet_NaN is @c true, a representation of a quiet NaN
459 /// @return A quiet NaN value
460 // NOLINTNEXTLINE(readability-identifier-naming)
461 static constexpr auto quiet_NaN() noexcept -> bool { return false; }
462 /// @brief For floating point types where @c has_signaling_NaN is @c true, a representation of a signaling NaN
463 /// @return A signaling NaN value
464 // NOLINTNEXTLINE(readability-identifier-naming)
465 static constexpr auto signaling_NaN() noexcept -> bool { return false; }
466 /// @brief For floating point types, the minimum positive denormalized value. If the representation has no
467 /// denormalized values, the minimum positive normalized value.
468 /// @return The minimum positive denormalized value
469 static constexpr auto denorm_min() noexcept -> bool { return false; }
470};
471
472/// @brief Numerator for @c log10(2) as a fraction
473///
474/// @c log10_2_num/log10_2_den is the same as @c log10(2) to 7 decimal places, which is more than we need to calculate
475/// the number of decimal digits
476constexpr int log10_2_num{643};
477/// @brief Denominator for @c log10(2) as a fraction
478constexpr int log10_2_den{2136};
479
480/// @brief Specialization of the implementation template for @c numeric_limits for @c float
481template <>
483 public:
484 /// @brief Is this a specialization for which the other values are meaningful? @c true if so, @c false otherwise
485 static constexpr bool is_specialized{true};
486 /// @brief Is the type an integral type? @c true if so, @c false otherwise
487 static constexpr bool is_integer{false};
488 /// @brief Is the type an exact type? @c true if so, @c false otherwise
489 static constexpr bool is_exact{true};
490 /// @brief Is the type a signed type? @c true if so, @c false otherwise
491 static constexpr bool is_signed{true};
492 /// @brief The base used for the representation.
493 static constexpr int radix{FLT_RADIX};
494 /// @brief The number of @c radix digits in the representation, ignoring any sign bit
495 static constexpr int digits{FLT_MANT_DIG};
496 /// @brief The maximum number of base-10 digits that can be completely represented in values of the type
497 static constexpr int digits10{FLT_DIG};
498 /// @brief @c true if the set of values representable by the type is bounded, otherwise @c false
499 static constexpr bool is_bounded{true};
500 /// @brief @c true if the set of values representable by the type is modulo, otherwise @c false
501 static constexpr bool is_modulo{false};
502 /// @brief @c true if there are trap representations of this type, otherwise @c false
503 static constexpr bool traps{false};
504
505 /// @brief For floating point types, the number of base-10 digits required to ensure that values which differ can be
506 /// differentiated
507 static constexpr int max_digits10{1 + ((log10_2_den - 1 + (digits * log10_2_num)) / log10_2_den)};
508 /// @brief For floating point types, the minimum negative integer such that @c radix raised to the power of one less
509 /// than that integer is a normalized floating point number.
510 static constexpr int min_exponent{FLT_MIN_EXP};
511 /// @brief For floating point types, the minimum negative integer such that 10 raised to the power of one less than
512 /// that integer is in the range of normalized floating point numbers.
513 static constexpr int min_exponent10{FLT_MIN_10_EXP};
514 /// @brief For floating point types, the maximum positive integer such that @c radix raised to the power of one less
515 /// than that integer is a representable finite floating point number.
516 static constexpr int max_exponent{FLT_MAX_EXP};
517 /// @brief For floating point types, the maximum positive integer such that 10 raised to the power of one less than
518 /// that integer is in the range of representable finite floating point numbers.
519 static constexpr int max_exponent10{FLT_MAX_10_EXP};
520 /// @brief For floating point types, @c true if the type has a representation of positive infinity, otherwise @c false
521 static constexpr bool has_infinity{true};
522 /// @brief For floating point types, @c true if the type has a representation of a quiet (non-signaling)
523 /// "Not-a-Number", otherwise @c false
524 // NOLINTNEXTLINE(readability-identifier-naming)
525 static constexpr bool has_quiet_NaN{true};
526 /// @brief For floating point types, @c true if the type has a representation of a signaling "Not-a-Number", otherwise
527 /// @c false
528 // NOLINTNEXTLINE(readability-identifier-naming)
529 static constexpr bool has_signaling_NaN{true};
530 /// @brief For floating point types, an indicator of whether the type has a representation of denormalized values
532 /// @brief For floating point types, @c true if loss of accuracy is detected as a denormalization loss rather than an
533 /// inexact result, otherwise @c false
534 static constexpr bool has_denorm_loss{false};
535 /// @brief For floating point types, @c true if the type adheres to the IEC559 standard, otherwise @c false
536 static constexpr bool is_iec559{true};
537 /// @brief For floating point types, @c true if tinyness is detected before rounding, otherwise @c false
538 static constexpr bool tinyness_before{false};
539 /// @brief For floating point types, an indicator of the default rounding style
541
542 /// @brief The maximum finite value
543 /// @return The maximum value
544 static constexpr auto max() noexcept -> float { return FLT_MAX; }
545 /// @brief The minimum finite value; the minimum positive normalized value for floating point types
546 /// @return The minimum value
547 static constexpr auto min() noexcept -> float { return FLT_MIN; }
548 /// @brief The minimum finite value such that there is no finite value @c y such that @c y<lowest()
549 /// @return The minimum value
550 static constexpr auto lowest() noexcept -> float { return -FLT_MAX; }
551
552 /// @brief For floating point types, the epsilon value: the difference between 1 and the least representable value
553 /// greater than 1
554 /// @return The epsilon value
555 static constexpr auto epsilon() noexcept -> float { return FLT_EPSILON; }
556 /// @brief For floating point types, the maximum rounding error
557 /// @return The maximum rounding error
558 // NOLINTNEXTLINE(readability-magic-numbers)
559 static constexpr auto round_error() noexcept -> float {
560 constexpr float rounding_error_value{0.5F};
562 }
563 /// @brief For floating point types where @c has_infinity is @c true, a representation of positive infinity
564 /// @return Positive infinity
565 static constexpr auto infinity() noexcept -> float { return __builtin_inff(); }
566 /// @brief For floating point types where @c has_quiet_NaN is @c true, a representation of a quiet NaN
567 /// @return A quiet NaN value
568 // NOLINTNEXTLINE(readability-identifier-naming)
569 static constexpr auto quiet_NaN() noexcept -> float {
570 // parasoft-begin-suppress AUTOSAR-A27_0_4-d "String literal expected for builtin"
571 return __builtin_nanf("0");
572 // parasoft-end-suppress AUTOSAR-A27_0_4-d
573 }
574 /// @brief For floating point types where @c has_signaling_NaN is @c true, a representation of a signaling NaN
575 /// @return A signaling NaN value
576 // NOLINTNEXTLINE(readability-identifier-naming)
577 static constexpr auto signaling_NaN() noexcept -> float {
578 // parasoft-begin-suppress AUTOSAR-A27_0_4-d "String literal expected for builtin"
579 return __builtin_nansf("0");
580 // parasoft-end-suppress AUTOSAR-A27_0_4-d
581 }
582 /// @brief For floating point types, the minimum positive denormalized value. If the representation has no
583 /// denormalized values, the minimum positive normalized value.
584 /// @return The minimum positive denormalized value
585 static constexpr auto denorm_min() noexcept -> float {
586 // NOLINTNEXTLINE(google-runtime-int)
587 static_assert(FLT_MANT_DIG < (sizeof(unsigned long long) * CHAR_BIT), "Ensure shift doesn't overflow");
588 // parasoft-begin-suppress AUTOSAR-A5_2_2-a "False positive: No C-style cast present"
589 // parasoft-begin-suppress AUTOSAR-M5_8_1-a "False positive: static_assert used to ensure no overflow"
590 // The minimum "normal" has a minimum exponent, an implied leading significant bit of 1 and a zero mantissa field.
591 // The minimum "denormal" value has minimum exponent, an implied leading significant bit of 0 and a mantissa field
592 // with a 1 in the least significant bit. This is the minimum "normal" value divided by 2 to the power of (1 less
593 // than the number of mantissa digits).
594 constexpr float min_value{FLT_MIN / static_cast<float>(1ULL << static_cast<unsigned>(FLT_MANT_DIG - 1))};
595 // parasoft-end-suppress AUTOSAR-M5_8_1-a
596 // parasoft-end-suppress AUTOSAR-A5_2_2-a
597 return min_value;
598 }
599};
600
601/// @brief Specialization of the implementation template for @c numeric_limits for @c double
602template <>
604 public:
605 /// @brief Is this a specialization for which the other values are meaningful? @c true if so, @c false otherwise
606 static constexpr bool is_specialized{true};
607 /// @brief Is the type an integral type? @c true if so, @c false otherwise
608 static constexpr bool is_integer{false};
609 /// @brief Is the type an exact type? @c true if so, @c false otherwise
610 static constexpr bool is_exact{true};
611 /// @brief Is the type a signed type? @c true if so, @c false otherwise
612 static constexpr bool is_signed{true};
613 /// @brief The base used for the representation.
614 static constexpr int radix{FLT_RADIX};
615 /// @brief The number of @c radix digits in the representation, ignoring any sign bit
616 static constexpr int digits{DBL_MANT_DIG};
617 /// @brief The maximum number of base-10 digits that can be completely represented in values of the type
618 static constexpr int digits10{DBL_DIG};
619 /// @brief @c true if the set of values representable by the type is bounded, otherwise @c false
620 static constexpr bool is_bounded{true};
621 /// @brief @c true if the set of values representable by the type is modulo, otherwise @c false
622 static constexpr bool is_modulo{false};
623 /// @brief @c true if there are trap representations of this type, otherwise @c false
624 static constexpr bool traps{false};
625
626 /// @brief For floating point types, the number of base-10 digits required to ensure that values which differ can be
627 /// differentiated
628 static constexpr int max_digits10{1 + ((log10_2_den - 1 + (digits * log10_2_num)) / log10_2_den)};
629 /// @brief For floating point types, the minimum negative integer such that @c radix raised to the power of one less
630 /// than that integer is a normalized floating point number.
631 static constexpr int min_exponent{DBL_MIN_EXP};
632 /// @brief For floating point types, the minimum negative integer such that 10 raised to the power of one less than
633 /// that integer is in the range of normalized floating point numbers.
634 static constexpr int min_exponent10{DBL_MIN_10_EXP};
635 /// @brief For floating point types, the maximum positive integer such that @c radix raised to the power of one less
636 /// than that integer is a representable finite floating point number.
637 static constexpr int max_exponent{DBL_MAX_EXP};
638 /// @brief For floating point types, the maximum positive integer such that 10 raised to the power of one less than
639 /// that integer is in the range of representable finite floating point numbers.
640 static constexpr int max_exponent10{DBL_MAX_10_EXP};
641 /// @brief For floating point types, @c true if the type has a representation of positive infinity, otherwise @c
642 /// false
643 static constexpr bool has_infinity{true};
644 /// @brief For floating point types, @c true if the type has a representation of a quiet (non-signaling)
645 /// "Not-a-Number", otherwise @c false
646 // NOLINTNEXTLINE(readability-identifier-naming)
647 static constexpr bool has_quiet_NaN{true};
648 /// @brief For floating point types, @c true if the type has a representation of a signaling "Not-a-Number",
649 /// otherwise
650 /// @c false
651 // NOLINTNEXTLINE(readability-identifier-naming)
652 static constexpr bool has_signaling_NaN{true};
653 /// @brief For floating point types, an indicator of whether the type has a representation of denormalized values
655 /// @brief For floating point types, @c true if loss of accuracy is detected as a denormalization loss rather than an
656 /// inexact result, otherwise @c false
657 static constexpr bool has_denorm_loss{false};
658 /// @brief For floating point types, @c true if the type adheres to the IEC559 standard, otherwise @c false
659 static constexpr bool is_iec559{true};
660 /// @brief For floating point types, @c true if tinyness is detected before rounding, otherwise @c false
661 static constexpr bool tinyness_before{false};
662 /// @brief For floating point types, an indicator of the default rounding style
664
665 // parasoft-begin-suppress AUTOSAR-A5_2_2-a "False positive: No C-style cast present"
666 /// @brief The maximum finite value
667 /// @return The maximum value
668 static constexpr auto max() noexcept -> double { return DBL_MAX; }
669 // parasoft-end-suppress AUTOSAR-A5_2_2-a
670
671 // parasoft-begin-suppress AUTOSAR-A5_2_2-a "False positive: No C-style cast present"
672 /// @brief The minimum finite value; the minimum positive normalized value for floating point types
673 /// @return The minimum value
674 static constexpr auto min() noexcept -> double { return DBL_MIN; }
675 // parasoft-end-suppress AUTOSAR-A5_2_2-a
676
677 // parasoft-begin-suppress AUTOSAR-A5_2_2-a "False positive: No C-style cast present"
678 /// @brief The minimum finite value such that there is no finite value @c y such that @c y<lowest()
679 /// @return The minimum value
680 static constexpr auto lowest() noexcept -> double { return -DBL_MAX; }
681 // parasoft-end-suppress AUTOSAR-A5_2_2-a
682
683 // parasoft-begin-suppress AUTOSAR-A5_2_2-a "False positive: No C-style cast present"
684 /// @brief For floating point types, the epsilon value: the difference between 1 and the least representable value
685 /// greater than 1
686 /// @return The epsilon value
687 static constexpr auto epsilon() noexcept -> double { return DBL_EPSILON; }
688 // parasoft-end-suppress AUTOSAR-A5_2_2-a
689
690 /// @brief For floating point types, the maximum rounding error
691 /// @return The maximum rounding error
692 // NOLINTNEXTLINE(readability-magic-numbers)
693 static constexpr auto round_error() noexcept -> double {
694 constexpr double rounding_error_value{0.5};
696 }
697 /// @brief For floating point types where @c has_infinity is @c true, a representation of positive infinity
698 /// @return Positive infinity
699 static constexpr auto infinity() noexcept -> double { return __builtin_inf(); }
700 /// @brief For floating point types where @c has_quiet_NaN is @c true, a representation of a quiet NaN
701 /// @return A quiet NaN value
702 // NOLINTNEXTLINE(readability-identifier-naming)
703 static constexpr auto quiet_NaN() noexcept -> double {
704 // parasoft-begin-suppress AUTOSAR-A27_0_4-d "String literal expected for builtin"
705 return __builtin_nan("0");
706 // parasoft-end-suppress AUTOSAR-A27_0_4-d
707 }
708 /// @brief For floating point types where @c has_signaling_NaN is @c true, a representation of a signaling NaN
709 /// @return A signaling NaN value
710 // NOLINTNEXTLINE(readability-identifier-naming)
711 static constexpr auto signaling_NaN() noexcept -> double {
712 // parasoft-begin-suppress AUTOSAR-A27_0_4-d "String literal expected for builtin"
713 return __builtin_nans("0");
714 // parasoft-end-suppress AUTOSAR-A27_0_4-d
715 }
716 /// @brief For floating point types, the minimum positive denormalized value. If the representation has no
717 /// denormalized values, the minimum positive normalized value.
718 /// @return The minimum positive denormalized value
719 static constexpr auto denorm_min() noexcept -> double {
720 // NOLINTNEXTLINE(google-runtime-int)
721 static_assert(DBL_MANT_DIG < (sizeof(unsigned long long) * CHAR_BIT), "Ensure shift doesn't overflow");
722 // parasoft-begin-suppress AUTOSAR-A5_2_2-a "False positive: No C-style cast present"
723 // parasoft-begin-suppress AUTOSAR-M5_8_1-a "False positive: static_assert used to ensure no overflow"
724 // The minimum "normal" has a minimum exponent, an implied leading significant bit of 1 and a zero mantissa field.
725 // The minimum "denormal" value has minimum exponent, an implied leading significant bit of 0 and a mantissa field
726 // with a 1 in the least significant bit. This is the minimum "normal" value divided by 2 to the power of (1 less
727 // than the number of mantissa digits).
728 constexpr double min_value{DBL_MIN / static_cast<double>(1ULL << static_cast<unsigned>(DBL_MANT_DIG - 1))};
729 // parasoft-end-suppress AUTOSAR-M5_8_1-a
730 // parasoft-end-suppress AUTOSAR-A5_2_2-a
731 return min_value;
732 }
733};
734
735} // namespace numeric_limits_detail
736
737/// @brief Traits class to provide information about the representation of arithmetic types.
738///
739/// The primary template is for non-arithmetic types, and provides default values of all the traits, which are zero, @c
740/// false, or default-constructed as appropriate. Specializations are provided for all built-in arithmetic types which
741/// provide appropriate values of all fields.
742///
743/// @tparam T The type for which to query information
744template <typename T>
746
747/// @brief Traits class to provide information about the representation of arithmetic types.
748///
749/// The primary template is for non-arithmetic types, and provides default values of all the traits, which are zero, @c
750/// false, or default-constructed as appropriate. Specializations are provided for all built-in arithmetic types which
751/// provide appropriate values of all fields.
752///
753/// @tparam T The type for which to query information
754template <typename T>
756
757// parasoft-begin-suppress AUTOSAR-A2_11_1-a "Use of volatile required by C++ standard"
758/// @brief Traits class to provide information about the representation of arithmetic types.
759///
760/// The primary template is for non-arithmetic types, and provides default values of all the traits, which are zero, @c
761/// false, or default-constructed as appropriate. Specializations are provided for all built-in arithmetic types which
762/// provide appropriate values of all fields.
763///
764/// @tparam T The type for which to query information
765template <typename T>
767// parasoft-end-suppress AUTOSAR-A2_11_1-a
768
769// parasoft-begin-suppress AUTOSAR-A2_11_1-a "Use of volatile required by C++ standard"
770/// @brief Traits class to provide information about the representation of arithmetic types.
771///
772/// The primary template is for non-arithmetic types, and provides default values of all the traits, which are zero, @c
773/// false, or default-constructed as appropriate. Specializations are provided for all built-in arithmetic types which
774/// provide appropriate values of all fields.
775///
776/// @tparam T The type for which to query information
777template <typename T>
778class numeric_limits<T const volatile> : public numeric_limits_detail::numeric_limits_impl<T> {};
779// parasoft-end-suppress AUTOSAR-A2_11_1-a
780
781} // namespace std
782
783#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_NUMERIC_LIMITS_HPP_
Implementation template for numeric_limits.
Definition numeric_limits.hpp:167
static constexpr bool has_signaling_NaN
For floating point types, true if the type has a representation of a signaling "Not-a-Number",...
Definition numeric_limits.hpp:214
static constexpr int digits10
The maximum number of base-10 digits that can be completely represented in values of the type.
Definition numeric_limits.hpp:182
static constexpr auto denorm_min() noexcept -> T
For floating point types, the minimum positive denormalized value. If the representation has no denor...
Definition numeric_limits.hpp:261
static constexpr bool has_quiet_NaN
For floating point types, true if the type has a representation of a quiet (non-signaling) "Not-a-Num...
Definition numeric_limits.hpp:210
static constexpr auto min() noexcept -> T
The minimum finite value; the minimum positive normalized value for floating point types.
Definition numeric_limits.hpp:235
static constexpr float_denorm_style has_denorm
For floating point types, an indicator of whether the type has a representation of denormalized value...
Definition numeric_limits.hpp:216
static constexpr auto lowest() noexcept -> T
The minimum finite value such that there is no finite value y such that y<lowest()
Definition numeric_limits.hpp:238
static constexpr bool is_iec559
For floating point types, true if the type adheres to the IEC559 standard, otherwise false.
Definition numeric_limits.hpp:221
static constexpr auto infinity() noexcept -> T
For floating point types where has_infinity is true, a representation of positive infinity.
Definition numeric_limits.hpp:249
static constexpr auto signaling_NaN() noexcept -> T
For floating point types where has_signaling_NaN is true, a representation of a signaling NaN.
Definition numeric_limits.hpp:257
static constexpr int max_exponent10
For floating point types, the maximum positive integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:204
static constexpr bool has_denorm_loss
For floating point types, true if loss of accuracy is detected as a denormalization loss rather than ...
Definition numeric_limits.hpp:219
static constexpr bool traps
true if there are trap representations of this type, otherwise false
Definition numeric_limits.hpp:188
static constexpr auto quiet_NaN() noexcept -> T
For floating point types where has_quiet_NaN is true, a representation of a quiet NaN.
Definition numeric_limits.hpp:253
static constexpr int digits
The number of radix digits in the representation, ignoring any sign bit.
Definition numeric_limits.hpp:180
static constexpr auto round_error() noexcept -> T
For floating point types, the maximum rounding error.
Definition numeric_limits.hpp:246
static constexpr int min_exponent
For floating point types, the minimum negative integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:195
static constexpr int min_exponent10
For floating point types, the minimum negative integer such that 10 raised to the power of one less t...
Definition numeric_limits.hpp:198
static constexpr bool is_bounded
true if the set of values representable by the type is bounded, otherwise false
Definition numeric_limits.hpp:184
static constexpr auto epsilon() noexcept -> T
For floating point types, the epsilon value: the difference between 1 and the least representable val...
Definition numeric_limits.hpp:243
static constexpr bool is_modulo
true if the set of values representable by the type is modulo, otherwise false
Definition numeric_limits.hpp:186
static constexpr bool is_specialized
Is this a specialization for which the other values are meaningful? true if so, false otherwise.
Definition numeric_limits.hpp:170
static constexpr bool is_integer
Is the type an integral type? true if so, false otherwise.
Definition numeric_limits.hpp:172
static constexpr bool has_infinity
For floating point types, true if the type has a representation of positive infinity,...
Definition numeric_limits.hpp:206
static constexpr float_round_style round_style
For floating point types, an indicator of the default rounding style.
Definition numeric_limits.hpp:225
static constexpr bool is_exact
Is the type an exact type? true if so, false otherwise.
Definition numeric_limits.hpp:174
static constexpr bool is_signed
Is the type a signed type? true if so, false otherwise.
Definition numeric_limits.hpp:176
static constexpr int max_digits10
For floating point types, the number of base-10 digits required to ensure that values which differ ca...
Definition numeric_limits.hpp:192
static constexpr int radix
The base used for the representation.
Definition numeric_limits.hpp:178
static constexpr bool tinyness_before
For floating point types, true if tinyness is detected before rounding, otherwise false.
Definition numeric_limits.hpp:223
static constexpr auto max() noexcept -> T
The maximum finite value.
Definition numeric_limits.hpp:230
static constexpr int max_exponent
For floating point types, the maximum positive integer such that radix raised to the power of one les...
Definition numeric_limits.hpp:201
Traits class to provide information about the representation of arithmetic types.
Definition numeric_limits.hpp:745
Definition numeric_limits.hpp:93
constexpr int log10_2_den
Denominator for log10(2) as a fraction.
Definition numeric_limits.hpp:478
constexpr int log10_2_num
Numerator for log10(2) as a fraction.
Definition numeric_limits.hpp:476
float_round_style
Enumeration describing possible rounding styles.
Definition numeric_limits.hpp:67
@ round_toward_zero
Round towards zero.
Definition numeric_limits.hpp:71
@ round_toward_infinity
Round towards positive infinity.
Definition numeric_limits.hpp:75
@ round_to_nearest
Round towards nearest.
Definition numeric_limits.hpp:73
@ round_toward_neg_infinity
Round towards negative infinity.
Definition numeric_limits.hpp:77
@ round_indeterminate
Rounding is indeterminable.
Definition numeric_limits.hpp:69
float_denorm_style
Enumeration describing possible denormalized value representation properties.
Definition numeric_limits.hpp:83
@ denorm_present
This type has denormalized values.
Definition numeric_limits.hpp:89
@ denorm_indeterminate
It cannot be determined if this type has denormalized values.
Definition numeric_limits.hpp:85
@ denorm_absent
This type has no denormalized values.
Definition numeric_limits.hpp:87
constexpr auto operator()(::arene::base::result< void, E > const &value) const noexcept(noexcept(hash< E >{}(std::declval< E const & >()))) -> std::size_t
Calculate the hash of a result.
Definition result.hpp:1827
static constexpr int digits10
The number of decimal digits.
Definition numeric_limits.hpp:103
static constexpr int8_t signed_max
The maximum value of a signed integer with this size.
Definition numeric_limits.hpp:109
static constexpr int unsigned_digits10
The number of decimal digits when unsigned.
Definition numeric_limits.hpp:105
static constexpr uint8_t unsigned_max
The maximum value of an unsigned integer with this size.
Definition numeric_limits.hpp:111
static constexpr int8_t signed_min
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:107
static constexpr int16_t signed_min
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:122
static constexpr int digits10
The number of decimal digits.
Definition numeric_limits.hpp:118
static constexpr int16_t signed_max
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:124
static constexpr uint16_t unsigned_max
The maximum value of an unsigned integer with this size.
Definition numeric_limits.hpp:126
static constexpr int unsigned_digits10
The number of decimal digits when unsigned.
Definition numeric_limits.hpp:120
static constexpr uint32_t unsigned_max
The maximum value of an unsigned integer with this size.
Definition numeric_limits.hpp:143
static constexpr int digits10
The number of decimal digits.
Definition numeric_limits.hpp:133
static constexpr int32_t signed_min
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:141
static constexpr int32_t signed_max
The maximum value of a signed integer with this size.
Definition numeric_limits.hpp:138
static constexpr int unsigned_digits10
The number of decimal digits when unsigned.
Definition numeric_limits.hpp:135
static constexpr int unsigned_digits10
The number of decimal digits when unsigned.
Definition numeric_limits.hpp:153
static constexpr int64_t signed_max
The maximum value of a signed integer with this size.
Definition numeric_limits.hpp:156
static constexpr uint64_t unsigned_max
The maximum value of an unsigned integer with this size.
Definition numeric_limits.hpp:161
static constexpr int64_t signed_min
The minimum value of a signed integer with this size.
Definition numeric_limits.hpp:159
static constexpr int digits10
The number of decimal digits.
Definition numeric_limits.hpp:151