Is it always guaranteed:
std::numeric_limits<int>::max() == INT_MAX
What does the C ++ standard say about this? I could not find any reference in the standard that would explicitly indicate this, but I continue to read that they should be equivalent.
What about C99 types that do not comply with the C ++ 98 standard for compilers that implement both C99 (at least long longpart) and C ++ 98? I am not sure if there is a guarantee that this is always true:
long long
std::numeric_limits<unsigned long long>::max() == ULLONG_MAX
Is that a reasonable guess?
My copy of the C ++ 2003 standard says templates numeric_limits<>::max()and min()will return values:
numeric_limits<>::max()
min()
CHAR_MIN, SHRT_MIN, FLT_MIN, DBL_MIN, ..CHAR_MAX, SHRT_MAX, FLT_MAX, DBL_MAX, ..
CHAR_MIN, SHRT_MIN, FLT_MIN, DBL_MIN, ..
CHAR_MIN, SHRT_MIN, FLT_MIN, DBL_MIN,
CHAR_MAX, SHRT_MAX, FLT_MAX, DBL_MAX, ..
CHAR_MAX, SHRT_MAX, FLT_MAX, DBL_MAX,
, . ISO/IEC 3: "[] ". .
: std::numeric_limits<int>::max() == INT_MAX.
unsigned long long , / . ...
unsigned long long, , , .
, .
, ++, ++ . , , .
Although, as far as I know, it is not part of the standard, this is certainly a reasonable assumption, especially if you have compilers from the same package or provider. For example, g ++ 4.3 just uses #defined values from <limits>in <climits>.
<limits>
<climits>
Source: https://habr.com/ru/post/1704876/More articles:How to prevent application timeout? - androidRails: finding multiple tables from a single query - ruby-on-railsВ С# есть ли способ последовательно получать выделенное текстовое содержимое окна, сфокусированного в данный момент? - c#Tools for receiving notifications of creation in Skype group chat - build-processTesting WCF Web Service with QTP - automated-testsAutomation Internet Explorer - internet-explorerDelphi ClientDataset Read Only - delphiWPF: Is a ListBox or Panel responsible for mouse navigation? - wpfgdiplus construct Image from line - c ++Java Swing Combobox with autocomplete and context menu - javaAll Articles