std::numeric_limits

Da cppreference.com.
< cpp‎ | types

 
 
Utilità libreria
Tipo di supporto (basic types, RTTI, type traits)
Gestione della memoria dinamica
La gestione degli errori
Programma di utilità
Funzioni variadic
Data e ora
Funzione oggetti
initializer_list(C++11)
bitset
hash(C++11)
Gli operatori relazionali
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Coppie e tuple
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Swap, in avanti e spostare
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
Tipo di supporto
Tipi base
Original:
Basic types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipi fondamentali
Larghezza fissa interi tipi(C++11)
Limiti numerici
Original:
Numeric limits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
numeric_limits
C numerico limita interfaccia
Informazioni sul tipo di runtime
Original:
Runtime type information
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipo tratti
Original:
Type traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Categorie di tipo primario
Original:
Primary type categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_void(C++11)
is_array(C++11)
is_pointer(C++11)
is_enum(C++11)
is_union(C++11)
is_class(C++11)
is_function(C++11)
is_reference(C++11)
is_lvalue_reference(C++11)
is_rvalue_reference(C++11)
is_member_pointer(C++11)
is_member_object_pointer(C++11)
is_member_function_pointer(C++11)
Proprietà del tipo
Original:
Type properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_const(C++11)
is_volatile(C++11)
is_pod(C++11)
is_empty(C++11)
is_polymorphic(C++11)
is_abstract(C++11)
Operazioni supportate
Original:
Supported operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_constructible
is_trivially_constructible
is_nothrow_constructible
(C++11)
(C++11)
(C++11)
is_default_constructible
is_trivially_default_constructible
is_nothrow_default_constructible
(C++11)
(C++11)
(C++11)
is_copy_constructible
is_trivially_copy_constructible
is_nothrow_copy_constructible
(C++11)
(C++11)
(C++11)
is_move_constructible
is_trivially_move_constructible
is_nothrow_move_constructible
(C++11)
(C++11)
(C++11)
is_assignable
is_trivially_assignable
is_nothrow_assignable
(C++11)
(C++11)
(C++11)
is_copy_assignable
is_trivially_copy_assignable
is_nothrow_copy_assignable
(C++11)
(C++11)
(C++11)
is_move_assignable
is_trivially_move_assignable
is_nothrow_move_assignable
(C++11)
(C++11)
(C++11)
is_destructible
is_trivially_destructible
is_nothrow_destructible
(C++11)
(C++11)
(C++11)
has_virtual_destructor(C++11)
I rapporti e le query di proprietà
Original:
Relationships and property queries
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_same(C++11)
is_base_of(C++11)
is_convertible(C++11)
alignment_of(C++11)
rank(C++11)
extent(C++11)
Tipo modifiche
Original:
Type modifications
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipo di trasformazioni
Original:
Type transformations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
aligned_storage(C++11)
aligned_union(C++11)
decay(C++11)
enable_if(C++11)
Digitare costanti tratto
Original:
Type trait constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
integral_constant(C++11)
 
 
Elemento definito nell'header <limits>
template<class T >class numeric_limits;
Il modello di classe numeric_limits fornisce un modo standardizzato per interrogare diverse proprietà di tipi fondamentali (ad esempio, il valore massimo possibile per il tipo int è std::numeric_limits<int>::max()).
Original:
The numeric_limits class template provides a standardized way to query various properties of fundamental types (e.g. the largest possible value for type int is std::numeric_limits<int>::max()).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Queste informazioni vengono fornite attraverso specializzazioni del modello numeric_limits. La libreria standard rende specializzazioni disponibili per tutti i tipi fondamentali:
Original:
This information is provided via specializations of the numeric_limits template. The standard library makes available specializations for all fundamental types:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Elemento definito nell'header <limits>
template<>class numeric_limits<bool>;

template<>class numeric_limits<char>;
template<>class numeric_limits<signedchar>;
template<>class numeric_limits<unsignedchar>;
template<>class numeric_limits<wchar_t>;
template<>class numeric_limits<char16_t>;   // C++11 feature
template<>class numeric_limits<char32_t>;   // C++11 feature
template<>class numeric_limits<short>;
template<>class numeric_limits<unsignedshort>;
template<>class numeric_limits<int>;
template<>class numeric_limits<unsignedint>;
template<>class numeric_limits<long>;
template<>class numeric_limits<unsignedlong>;
template<>class numeric_limits<longlong>;
template<>class numeric_limits<unsignedlonglong>;
template<>class numeric_limits<float>;
template<>class numeric_limits<double>;

template<>class numeric_limits<longdouble>;
Inoltre, esiste una specializzazione per ogni cv qualificato versione di ciascun tipo fondamentale, identica alla specializzazione qualificato, ad esempio std::numeric_limits<const int>, std::numeric_limits<volatile int> e std::numeric_limits<const volatile int> sono forniti e sono equivalenti a std::numeric_limits<int>.
Original:
Additionally, a specialization exists for every cv-qualified version of each fundamental type, identical to the unqualified specialization, e.g. std::numeric_limits<const int>, std::numeric_limits<volatile int>, and std::numeric_limits<const volatile int> are provided and are equivalent to std::numeric_limits<int>.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
I tipi di libreria standard, che sono gli alias di tipi fondamentali (come ad esempio std::size_t o std::streamsize possono essere esaminati anche con i caratteri morfologici std::numeric_limits.
Original:
The standard library types that are aliases of fundamental types (such as std::size_t or std::streamsize may also be examined with the std::numeric_limits type traits.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
implementazioni possono prevedere specializzazioni std::numeric_limits per l'attuazione di specifici tipi: ad es.. GCC fornisce std::numeric_limits<__int128> librerie possono aggiungere specializzazioni per la biblioteca forniti tipi, ad esempio OpenEXR prevede std::numeric_limits<half> per un 16-bit in virgola mobile di tipo.
Original:
Implementations may provide specializations of std::numeric_limits for implementation-specific types: e.g. GCC provides std::numeric_limits<__int128>. Libraries may add specializations for library-provided types, e.g. OpenEXR provides std::numeric_limits<half> for a 16-bit floating-point type.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica]Membri costanti

identifica i tipi per i quali è specializzata std::numeric_limits
Original:
identifies types for which std::numeric_limits is specialized
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
identifica i tipi di firma
Original:
identifies signed types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
identifica i tipi interi
Original:
identifies integer types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
identifica i tipi esatti
Original:
identifies exact types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
identifica i tipi a virgola mobile che possono rappresentare la speciale "positive infinity" valore
Original:
identifies floating-point types that can represent the special value "positive infinity"
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
identifica i tipi a virgola mobile che possono rappresentare il valore speciale "tranquilla, non-a-number" (NaN)
Original:
identifies floating-point types that can represent the special value "quiet not-a-number" (NaN)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
identifica i tipi a virgola mobile che possono rappresentare il valore speciale "segnalazione non-a-number" (NaN)
Original:
identifies floating-point types that can represent the special value "signaling not-a-number" (NaN)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
identifica lo stile denormalizzazione utilizzato dal tipo a virgola mobile
Original:
identifies the denormalization style used by the floating-point type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
identifies the floating-point types that detect loss of precision as denormalization loss rather than inexact result
(pubblico membro statico costante)[modifica]
[statico]
identifica lo stile di arrotondamento usato dal tipo
Original:
identifies the rounding style used by the type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
individua le IEC 559/IEEE 754 tipi a virgola mobile
Original:
identifies the IEC 559/IEEE 754 floating-point types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
identifies types that represent a finite set of values
(pubblico membro statico costante)[modifica]
[statico]
identifica i tipi che gestiscono trabocca con l'aritmetica modulo
Original:
identifies types that handle overflows with modulo arithmetic
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
numero di cifre radix che possono essere rappresentati senza cambiamenti
Original:
number of radix digits that can be represented without change
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
numero di cifre decimali che possono essere rappresentati senza modifiche
Original:
number of decimal digits that can be represented without change
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico](C++11)
numero di cifre decimali necessario differenziare tutti i valori di questo tipo
Original:
number of decimal digits necessary to differentiate all values of this type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
la radice o base intero utilizzato dalla rappresentazione del tipo specificato
Original:
the radix or integer base used by the representation of the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
oltre la più piccola potenza negativa della radice che è una valida virgola mobile normalizzato valore uno
Original:
one more than the smallest negative power of the radix that is a valid normalized floating-point value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
la più piccola potenza negativa di dieci, che è un valido normalizzato valore a virgola mobile
Original:
the smallest negative power of ten that is a valid normalized floating-point value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
maggiore della massima potenza intera della radice che è una valida finita valore a virgola mobile uno
Original:
one more than the largest integer power of the radix that is a valid finite floating-point value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
la più grande potenza intera di 10 che è un valido finita valore a virgola mobile
Original:
the largest integer power of 10 that is a valid finite floating-point value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
[statico]
identifica i tipi che possono causare operazioni aritmetiche per intrappolare
Original:
identifies types which can cause arithmetic operations to trap
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]
identifica i tipi a virgola mobile che rilevano tinyness prima dell'arrotondamento
Original:
identifies floating-point types that detect tinyness before rounding
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(pubblico membro statico costante)[modifica]

[modifica]Membri funzioni

[statico]
restituisce il più piccolo valore finito del tipo specificato
Original:
returns the smallest finite value of the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]
[statico](C++11)
restituisce il valore più basso finito del tipo specificato
Original:
returns the lowest finite value of the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]
[statico]
restituisce il più grande valore finito del tipo specificato
Original:
returns the largest finite value of the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]
[statico]
restituisce la differenza tra 1.0 e il valore successivo rappresentabile di un dato tipo a virgola mobile
Original:
returns the difference between 1.0 and the next representable value of the given floating-point type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]
[statico]
restituisce l'errore massimo di arrotondamento di un dato tipo a virgola mobile
Original:
returns the maximum rounding error of the given floating-point type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]
[statico]
restituisce il valore positivo infinito di un dato tipo a virgola mobile
Original:
returns the positive infinity value of the given floating-point type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]
[statico]
restituisce un valore NaN tranquilla di un dato tipo a virgola mobile
Original:
returns a quiet NaN value of the given floating-point type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]
restituisce un valore NaN segnalazione di un dato tipo a virgola mobile
Original:
returns a signaling NaN value of the given floating-point type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]
[statico]
restituisce il più piccolo valore positivo subnormale di un dato tipo a virgola mobile
Original:
returns the smallest positive subnormal value of the given floating-point type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico statico)[modifica]

[modifica]Helper classi

indica virgola mobile modalità di arrotondamento
Original:
indicates floating-point rounding modes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(enum)[modifica]
indica le modalità a virgola mobile denormalizzazione
Original:
indicates floating-point denormalization modes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(enum)[modifica]

[modifica]Rapporti con C biblioteca costanti macro

Specialization Members
min()lowest()
(C++11)
max()epsilon()digitsdigits10min_exponentmin_exponent10max_exponentmax_exponent10radix
numeric_limits< bool >2
numeric_limits< char >CHAR_MINCHAR_MINCHAR_MAX2
numeric_limits< signedchar >SCHAR_MINSCHAR_MINSCHAR_MAX2
numeric_limits< unsignedchar >00UCHAR_MAX2
numeric_limits< wchar_t >WCHAR_MINWCHAR_MINWCHAR_MAX2
numeric_limits< char16_t >00UINT_LEAST16_MAX2
numeric_limits< char32_t >00UINT_LEAST32_MAX2
numeric_limits< short >SHRT_MINSHRT_MINSHRT_MAX2
numeric_limits< signedshort >
numeric_limits< unsignedshort >00USHRT_MAX2
numeric_limits< int >INT_MININT_MININT_MAX2
numeric_limits< signedint >
numeric_limits< unsignedint >00UINT_MAX2
numeric_limits< long >LONG_MINLONG_MINLONG_MAX2
numeric_limits< signedlong >
numeric_limits< unsignedlong >00ULONG_MAX2
numeric_limits< longlong >LLONG_MINLLONG_MINLLONG_MAX2
numeric_limits< signedlonglong >
numeric_limits< unsignedlonglong >00ULLONG_MAX2
numeric_limits< float >FLT_MIN-FLT_MAXFLT_MAXFLT_EPSILONFLT_MANT_DIGFLT_DIGFLT_MIN_EXPFLT_MIN_10_EXPFLT_MAX_EXPFLT_MAX_10_EXPFLT_RADIX
numeric_limits< double >DBL_MIN-DBL_MAXDBL_MAXDBL_EPSILONDBL_MANT_DIGDBL_DIGDBL_MIN_EXPDBL_MIN_10_EXPDBL_MAX_EXPDBL_MAX_10_EXPFLT_RADIX
numeric_limits< longdouble >LDBL_MIN-LDBL_MAXLDBL_MAXLDBL_EPSILONLDBL_MANT_DIGLDBL_DIGLDBL_MIN_EXPLDBL_MIN_10_EXPLDBL_MAX_EXPLDBL_MAX_10_EXPFLT_RADIX

[modifica]Esempio

#include <limits>#include <iostream>   int main(){std::cout<<"type\tlowest\thighest\n";std::cout<<"int\t"<< std::numeric_limits<int>::lowest()<<'\t'<< std::numeric_limits<int>::max()<<'\n';std::cout<<"float\t"<< std::numeric_limits<float>::lowest()<<'\t'<< std::numeric_limits<float>::max()<<'\n';std::cout<<"double\t"<< std::numeric_limits<double>::lowest()<<'\t'<< std::numeric_limits<double>::max()<<'\n';}

Possible output:

type lowest highest int -2147483648 2147483647 float -3.40282e+38 3.40282e+38 double -1.79769e+308 1.79769e+308
close