Members of the numeric_limits Class

Illustrates how to use the members of the numeric_limits class in Visual C++.

To reference one of the members of this class, you need to specify the type that you want to obtain information about and the member name. The return will either be a value of 1 for true or 0 for false. For example, numeric_limits<int>::min will return the minimum value for an int.

Note

Some of the members are valid only for certain types. Please refer to the Online Help to determine if a member is valid only for a certain type.

1 The minimum value for char is -128
2 The minimum value for int is -2147483648
3 The maximum value for char is 127
4 The maximum value for int is 2147483647
5 The number of bits to represent a char is 7
6 The number of bits to represent an int is 31
7 The number of digits representable in base 10 for float is 6
8 Is a char signed? 1
9 Is an unsigned integer signed? 0
10 Is an integer an integer? 1
11 Is a float an integer? 0
12 Is an integer exact? 1
13 Is a float exact? 0
14 The radix for float is 2
15 The epsilon for float is 1.19209e-007
16 The round error for float is 0.5
17 The minimum exponent for float is -125
18 The minimum exponent in base 10 -37
19 The maximum exponent is 128
20 The maximum exponent in base 10 38
21 Can float represent positive infinity? 1
22 Can double represent positive infinity? 1
23 Can int represent positive infinity? 0
24 Can float represent a NaN? 1
25 Can float represent a signaling NaN? 1
26 Does float allow denormalized values? 1
27 Does float detect denormalization loss? 1
28 Representation of positive infinity for float 1.#INF
29 Representation of quiet NaN for float 1.#QNAN
30 Minimum denormalized number for float 1.4013e-045
31 Minimum positive denormalized value for float 1.4013e-045
32 Does float adhere to IEC 559 standard? 1
33 Is float bounded? 1
34 Is float modulo? 0
35 Is int modulo? 0
36 Is trapping implemented for float? 1
37 Is tinyness detected before rounding? 1
38 What is the rounding style for float? 1
39 What is the rounding style for int? 0
40 How does a float represent a signaling NaN? 1.#QNAN
41 Is int specialized? 1