Sujet : Re: remark on defining size of basic types
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 04. Apr 2024, 17:02:16
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uumiu8$o78i$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla Thunderbird
On 4/4/24 09:15, Janis Papanagnou wrote:
...
Since I remember C had always just defined a '<=' (or '>=') relation
between the unsized basic integral data types.
There's several things not quite right about the form of that sentence,
so I'm not quite sure what you meant to say, but C originally defined
the relational operators for any arithmetic type (and for pointers to
compatible object types), including the unsigned types..
Some complications have been added since then. When extended integer
types and _Bool were added, the definitions were adjusted so that the
integer promotion rules apply to _Bool, and extended integer types are
included along with other integer types. When _Complex and _Imaginary
were added, the operands to the relational operators were explicitly
required to be real (which, as C defines the term, includes all integer
types). When decimal floating types were introduced, they added a
prohibition on comparing such values with values that had a standard
floating types. However, nothing matching the restrictions you imply has
ever been true.