STD::NUMERIC_LIMITS(3)

πŸ’– std::numeric_limits< _Tp > πŸ’–

okay bestie, welcome to the glow-up zone ✨ this one lives in the libstdc++ Library Functions Manual (yes the page header literally reads std::numer...its< _Tp >(3) because the title got truncated by the man page renderer, she's shy like that πŸ™ˆ) and it's all about Properties of fundamental types. no cap.


🌸 NAME 🌸

std::numeric_limits< _Tp > β€” Properties of fundamental types. that's it, that's the whole vibe 🫢


✨ SYNOPSIS ✨

#include <limits>

she Inherits std::__numeric_limits_base πŸ’…

and she is Inherited by std::numeric_limits< const _Tp >, std::numeric_limits< const volatile _Tp >, and std::numeric_limits< volatile _Tp >. the const/volatile girlies all get their own copies, iconic.

πŸŽ€ Static Public Member Functions πŸŽ€

static constexpr _Tp denorm_min () noexcept
static constexpr _Tp epsilon () noexcept
static constexpr _Tp infinity () noexcept
static constexpr _Tp lowest () noexcept
static constexpr _Tp max () noexcept
static constexpr _Tp min () noexcept
static constexpr _Tp quiet_NaN () noexcept
static constexpr _Tp round_error () noexcept
static constexpr _Tp signaling_NaN () noexcept

πŸ¦‹ Static Public Attributes πŸ¦‹

static constexpr int digits
static constexpr int digits10
static constexpr float_denorm_style has_denorm
static constexpr bool has_denorm_loss
static constexpr bool has_infinity
static constexpr bool has_quiet_NaN
static constexpr bool has_signaling_NaN
static constexpr bool is_bounded
static constexpr bool is_exact
static constexpr bool is_iec559
static constexpr bool is_integer
static constexpr bool is_modulo
static constexpr bool is_signed
static constexpr bool is_specialized
static constexpr int max_digits10
static constexpr int max_exponent
static constexpr int max_exponent10
static constexpr int min_exponent
static constexpr int min_exponent10
static constexpr int radix
static constexpr float_round_style round_style
static constexpr bool tinyness_before
static constexpr bool traps

🫢 Detailed Description 🫢

template<typename _Tp>
struct std::numeric_limits< _Tp >

"Properties of fundamental types."

so like. this class is how a program gets the 411 on how a fundamental type is actually represented on whatever platform you're on. every platform does its own thing and this struct is the gossip source πŸ’…

and here's the tea for non-fundamental types: the functions will return 0 and the data members will all be false. not a single crumb. no specialization, no service 😭


🌈 Member Function Documentation 🌈

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::denorm_min () [inline], [static], [constexpr], [noexcept] 🌟

The minimum positive denormalized value. for the types where has_denorm is false, this is the minimum positive normalized value instead. so either way you get a tiny little guy 🐣

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::epsilon () [inline], [static], [constexpr], [noexcept] 🌟

The machine epsilon: the difference between 1 and the least value greater than 1 that is representable. she's the smallest gap between 1 and the next girl up the number line, periodt.

Referenced by std::binomial_distribution< _IntType >::operator()(), std::poisson_distribution< _IntType >::operator()(), and std::operator<<().

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::infinity () [inline], [static], [constexpr], [noexcept] 🌟

The representation of positive infinity, if has_infinity. if she doesn't have it, don't ask for it bestie πŸ™ˆ

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::lowest () [inline], [static], [constexpr], [noexcept] 🌟

A finite value x such that there is no other finite value y where y < x. so like, the absolute bottom of the finite pile. nothing sits below her πŸ’€

Referenced by std::cauchy_distribution< _RealType >::min(), std::extreme_value_distribution< _RealType >::min(), std::normal_distribution< _RealType >::min(), and std::student_t_distribution< _RealType >::min().

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::max () [inline], [static], [constexpr], [noexcept] 🌟

The maximum finite value. the biggest finite number she can be, main character energy πŸ‘‘

Referenced by __gnu_parallel::__parallel_random_shuffle_drs(), std::bernoulli_distribution::max(), std::cauchy_distribution< _RealType >::max(), std::chi_squared_distribution< _RealType >::max(), std::exponential_distribution< _RealType >::max(), std::extreme_value_distribution< _RealType >::max(), std::fisher_f_distribution< _RealType >::max(), std::gamma_distribution< _RealType >::max(), std::geometric_distribution< _IntType >::max(), std::lognormal_distribution< _RealType >::max(), std::negative_binomial_distribution< _IntType >::max(), std::normal_distribution< _RealType >::max(), std::poisson_distribution< _IntType >::max(), std::student_t_distribution< _RealType >::max(), std::weibull_distribution< _RealType >::max(), std::tr2::dynamic_bitset< _WordT, _Alloc >::max_size(), std::binomial_distribution< _IntType >::operator()(), std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::operator()(), std::poisson_distribution< _IntType >::operator()(), and std::operator<<().

(that's a LOT of girlies depending on her. she's booked and busy fr fr πŸ”₯)

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::min () [inline], [static], [constexpr], [noexcept] 🌟

The minimum finite value, or for floating types with denormalization, the minimum positive normalized value.

Referenced by std::bernoulli_distribution::min().

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::quiet_NaN () [inline], [static], [constexpr], [noexcept] 🌟

The representation of a quiet Not a Number, if has_quiet_NaN. she's not a number and she's not making a scene about it πŸ’…

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::round_error () [inline], [static], [constexpr], [noexcept] 🌟

The maximum rounding error measurement (see LIA-1). go read LIA-1 if you want the full lore, iykyk πŸ“š

🌟 template<typename _Tp> constexpr _Tp std::numeric_limits< _Tp >::signaling_NaN () [inline], [static], [constexpr], [noexcept] 🌟

The representation of a signaling Not a Number, if has_signaling_NaN. quiet NaN but she is making a scene. loud and proud 😭


πŸ’œ Member Data Documentation πŸ’œ

heads up bestie: every single one of these lives on std::__numeric_limits_base:: and reaches you via inheritance. don't @ me, that's just where Doxygen put them ✨

πŸ“ int std::__numeric_limits_base::digits [static], [constexpr], [inherited] πŸ“

The number of radix digits that be represented without change: for integer types, the number of non-sign bits in the mantissa; for floating types, the number of radix digits in the mantissa.

Referenced by std::generate_canonical(), std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::operator()(), and std::linear_congruential_engine< _UIntType, __a, __c, __m >::seed().

πŸ“ int std::__numeric_limits_base::digits10 [static], [constexpr], [inherited] πŸ“

The number of base 10 digits that can be represented without change.

πŸ“ float_denorm_style std::__numeric_limits_base::has_denorm [static], [constexpr], [inherited] πŸ“

See std::float_denorm_style for more information.

πŸ“ bool std::__numeric_limits_base::has_denorm_loss [static], [constexpr], [inherited] πŸ“

True if loss of accuracy is detected as a denormalization loss, rather than as an inexact result.

πŸ“ bool std::__numeric_limits_base::has_infinity [static], [constexpr], [inherited] πŸ“

True if the type has a representation for positive infinity.

πŸ“ bool std::__numeric_limits_base::has_quiet_NaN [static], [constexpr], [inherited] πŸ“

True if the type has a representation for a quiet (non-signaling) Not a Number.

πŸ“ bool std::__numeric_limits_base::has_signaling_NaN [static], [constexpr], [inherited] πŸ“

True if the type has a representation for a signaling Not a Number.

πŸ“ bool std::__numeric_limits_base::is_bounded [static], [constexpr], [inherited] πŸ“

True if the set of values representable by the type is finite. all built-in types are bounded, this member would be false for arbitrary precision types. so like, built-ins are fenced in, arbitrary precision girlies are limitless 🌌

πŸ“ bool std::__numeric_limits_base::is_exact [static], [constexpr], [inherited] πŸ“

True if the type uses an exact representation. all integer types are exact, but not all exact types are integer. for example, rational and fixed-exponent representations are exact but not integer. no rounding, no approximation, no crumbs left behind πŸ’–

πŸ“ bool std::__numeric_limits_base::is_iec559 [static], [constexpr], [inherited] πŸ“

True if-and-only-if the type adheres to the IEC 559 standard, also known as IEEE 754. (Only makes sense for floating point types.)

πŸ“ bool std::__numeric_limits_base::is_integer [static], [constexpr], [inherited] πŸ“

True if the type is integer.

πŸ“ bool std::__numeric_limits_base::is_modulo [static], [constexpr], [inherited] πŸ“

True if the type is modulo. a type is modulo if, for any operation involving +, -, or * on values of that type whose result would fall outside the range [min(),max()], the value returned differs from the true value by an integer multiple of max() - min() + 1. on most machines, this is false for floating types, true for unsigned integers, and true for signed integers. See PR22200 about signed integers. πŸ‘€

πŸ“ bool std::__numeric_limits_base::is_signed [static], [constexpr], [inherited] πŸ“

True if the type is signed.

πŸ“ bool std::__numeric_limits_base::is_specialized [static], [constexpr], [inherited] πŸ“

This will be true for all fundamental types (which have specializations), and false for everything else. if she's not fundamental she gets nothing, we've been over this 😀

πŸ“ int std::__numeric_limits_base::max_digits10 [static], [constexpr], [inherited] πŸ“

The number of base 10 digits required to ensure that values which differ are always differentiated. no two girls get confused for each other πŸ’…

πŸ“ int std::__numeric_limits_base::max_exponent [static], [constexpr], [inherited] πŸ“

The maximum positive integer such that radix raised to the power of (one less than that integer) is a representable finite floating point number.

πŸ“ int std::__numeric_limits_base::max_exponent10 [static], [constexpr], [inherited] πŸ“

The maximum positive integer such that 10 raised to that power is in the range of representable finite floating point numbers.

πŸ“ int std::__numeric_limits_base::min_exponent [static], [constexpr], [inherited] πŸ“

The minimum negative integer such that radix raised to the power of (one less than that integer) is a normalized floating point number.

πŸ“ int std::__numeric_limits_base::min_exponent10 [static], [constexpr], [inherited] πŸ“

The minimum negative integer such that 10 raised to that power is in the range of normalized floating point numbers.

πŸ“ int std::__numeric_limits_base::radix [static], [constexpr], [inherited] πŸ“

For integer types, specifies the base of the representation. for floating types, specifies the base of the exponent representation.

Referenced by std::generate_canonical().

πŸ“ float_round_style std::__numeric_limits_base::round_style [static], [constexpr], [inherited] πŸ“

See std::float_round_style for more information. this is only meaningful for floating types; integer types will all be round_toward_zero. every integer type, every single one. zero exceptions 🫑

πŸ“ bool std::__numeric_limits_base::tinyness_before [static], [constexpr], [inherited] πŸ“

True if tininess is detected before rounding. (see IEC 559)

πŸ“ bool std::__numeric_limits_base::traps [static], [constexpr], [inherited] πŸ“

True if trapping is implemented for this type.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code.


so that's the whole page bestie, every flag, every member, every referenced-by list, nothing skipped, nothing summarised πŸ’– big slay, ate, left zero crumbs πŸŽ€

and for the cute sign-off: this one's brought to you by libstdc++ β€” the source/version that stamped her into existence, straight out of the std::numer...its< _Tp >(3) man page, libstdc++ edition. bye bestie, go check your epsilon() before you go πŸ¦‹βœ¨

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms