обра дин |
[Dec. 18th, 2018|07:46 pm] |
|
|
|
Comments: |
| From: | dolmatt |
Date: | December 23rd, 2018 - 03:10 pm |
---|
| | | (Link) |
|
Короче, я понял. Стандарт языка С++ ссылается на стандарт языка C: говорится, что контент climits точно такой же, как limits.h В свою очередь, стандарт C содержит следующие предписания: implementation-defined values shall be equal or greater in magnitude (absolute value) to those shown, with the same sign. number of bits for smallest object that is not a bit-field (byte) CHAR_BIT 8
minimum value for an object of type signed char SCHAR_MIN -127 // -(2^7-1)
maximum value for an object of type signed char SCHAR_MAX +127 // 2^7-1
maximum value for an object of type unsigned char UCHAR_MAX 255 // 2^8-1
minimum value for an object of type char CHAR_MIN see below
maximum value for an object of type char CHAR_MAX see below
If the value of an object of type char is treated as a signed integer when used in an expression, the value of CHAR_MIN shall be the same as that of SCHAR_MIN and the value of CHAR_MAX shall be the same as that of SCHAR_MAX.
Otherwise, the value of CHAR_MIN shall be 0 and the value of CHAR_MAX shall be the same as that of UCHAR_MAX.
The value UCHAR_MAX shall equal 2^CHAR_BIT-1. | |