---
name: "std::numeric_limits"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::numeric_limits/3cxx"
---

# std::numeric\_limits(3cxx)

Properties of fundamental types.

## NAME

std::numeric\_limits\< \_Tp \> - Properties of fundamental types.

## SYNOPSIS

`#include <limits>`

Inherits **std::\_\_numeric\_limits\_base**.

Inherited by std::numeric\_limits\< const \_Tp \>, std::numeric\_limits\< const volatile \_Tp \>, and std::numeric\_limits\< volatile \_Tp \>.

### 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.

This class allows a program to obtain information about the representation of a fundamental type on a given platform. For non-fundamental types, the functions will return 0 and the data members will all be `false`.

## Member Function Documentation

### template\<typename \_Tp \> static constexpr \_Tp std::numeric\_limits\< \_Tp \>::denorm\_min ()` [inline]`, ` [static]`, ` [constexpr]`, ` [noexcept]`

The minimum positive denormalized value. For types where `has_denorm` is false, this is the minimum positive normalized value. \

### template\<typename \_Tp \> static 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. \

Referenced by **std::generate\_canonical()**, **std::binomial\_distribution\< \_IntType \>::operator()()**, **std::poisson\_distribution\< \_IntType \>::operator()()**, and **std::operator\<\<()**.

### template\<typename \_Tp \> static constexpr \_Tp std::numeric\_limits\< \_Tp \>::infinity ()` [inline]`, ` [static]`, ` [constexpr]`, ` [noexcept]`

The representation of positive infinity, if `has_infinity`. \

### template\<typename \_Tp \> static 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. \

Referenced by **std::normal\_distribution\< \_RealType \>::min()**, **std::cauchy\_distribution\< \_RealType \>::min()**, **std::student\_t\_distribution\< \_RealType \>::min()**, and **std::extreme\_value\_distribution\< \_RealType \>::min()**.

### template\<typename \_Tp \> static constexpr \_Tp std::numeric\_limits\< \_Tp \>::max ()` [inline]`, ` [static]`, ` [constexpr]`, ` [noexcept]`

The maximum finite value. \

Referenced by **std::normal\_distribution\< \_RealType \>::max()**, **std::lognormal\_distribution\< \_RealType \>::max()**, **std::gamma\_distribution\< \_RealType \>::max()**, **std::chi\_squared\_distribution\< \_RealType \>::max()**, **std::cauchy\_distribution\< \_RealType \>::max()**, **std::fisher\_f\_distribution\< \_RealType \>::max()**, **std::student\_t\_distribution\< \_RealType \>::max()**, **std::bernoulli\_distribution::max()**, **std::geometric\_distribution\< \_IntType \>::max()**, **std::negative\_binomial\_distribution\< \_IntType \>::max()**, **std::poisson\_distribution\< \_IntType \>::max()**, **std::exponential\_distribution\< \_RealType \>::max()**, **std::weibull\_distribution\< \_RealType \>::max()**, **std::extreme\_value\_distribution\< \_RealType \>::max()**, **std::independent\_bits\_engine\< \_RandomNumberEngine, \_\_w, \_UIntType \>::operator()()**, **std::binomial\_distribution\< \_IntType \>::operator()()**, **std::poisson\_distribution\< \_IntType \>::operator()()**, and **std::operator\<\<()**.

### template\<typename \_Tp \> static 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 \> static constexpr \_Tp std::numeric\_limits\< \_Tp \>::quiet\_NaN ()` [inline]`, ` [static]`, ` [constexpr]`, ` [noexcept]`

The representation of a quiet Not a Number, if `has_quiet_NaN`.

### template\<typename \_Tp \> static constexpr \_Tp std::numeric\_limits\< \_Tp \>::round\_error ()` [inline]`, ` [static]`, ` [constexpr]`, ` [noexcept]`

The maximum rounding error measurement (see LIA-1). \

### template\<typename \_Tp \> static constexpr \_Tp std::numeric\_limits\< \_Tp \>::signaling\_NaN ()` [inline]`, ` [static]`, ` [constexpr]`, ` [noexcept]`

The representation of a signaling Not a Number, if `has_signaling_NaN`.

## Member Data Documentation

### constexpr 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. \

### constexpr int std::\_\_numeric\_limits\_base::digits10` [static]`, ` [constexpr]`, ` [inherited]`

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

### constexpr float\_denorm\_style std::\_\_numeric\_limits\_base::has\_denorm` [static]`, ` [constexpr]`, ` [inherited]`

See std::float\_denorm\_style for more information. \

### constexpr 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.

### constexpr bool std::\_\_numeric\_limits\_base::has\_infinity` [static]`, ` [constexpr]`, ` [inherited]`

True if the type has a representation for positive infinity. \

### constexpr 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. \

### constexpr bool std::\_\_numeric\_limits\_base::has\_signaling\_NaN` [static]`, ` [constexpr]`, ` [inherited]`

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

### constexpr 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.

### constexpr 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.

### constexpr 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.) \

### constexpr bool std::\_\_numeric\_limits\_base::is\_integer` [static]`, ` [constexpr]`, ` [inherited]`

True if the type is integer. \

### constexpr 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. \

### constexpr bool std::\_\_numeric\_limits\_base::is\_signed` [static]`, ` [constexpr]`, ` [inherited]`

True if the type is signed. \

### constexpr 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. \

### constexpr 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. \

### constexpr 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. \

### constexpr 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. \

### constexpr 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. \

### constexpr 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. \

### constexpr 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. \

### constexpr 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. \

### constexpr bool std::\_\_numeric\_limits\_base::tinyness\_before` [static]`, ` [constexpr]`, ` [inherited]`

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

### constexpr 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.
