Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Spiros Bousbouras <spibou@gmail.com> |
|---|---|
| Newsgroups | comp.std.c |
| Subject | Problem with ranks |
| Message-ID | <ym86jKAqoCXFYStC@bongo-ra.co> (permalink) |
| Organization | virginmedia.com |
| Date | 2020-05-30 01:55 +0000 |
Assume an implementation with 2 extended integer types as follows : - INT1 is signed , has 23 value bits and no corresponding unsigned type. - UINT1 is unsigned , has 40 value bits and no corresponding signed type. - Both have rank greater than int . - The rank of UINT1 is smaller than the rank of INT1 . The last stipulation is perverse but I don't see anything in "6.3.1.1 Boolean, characters, and integers" which forbids it. With the above , if you have an addition where one operand is of type INT1 and the other of type UINT1 then none of the possibilities (rules) in "6.3.1.8 Usual arithmetic conversions" after the part "Otherwise, the integer promotions are performed on both operands. Then the following rules are applied to the promoted operands:" is applicable. This even if we assume that ranks are always comparable which isn't clear. So I think that the following rule should be added to 6.3.1.1 : The rank of an integer type shall be greater or equal than the rank of any integer type with less or equal precision. -- vlaho.ninja/prog
Back to comp.std.c | Previous | Next — Next in thread | Find similar | Unroll thread
Problem with ranks Spiros Bousbouras <spibou@gmail.com> - 2020-05-30 01:55 +0000
Re: Problem with ranks James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-05-30 02:48 -0400
Re: Problem with ranks Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-05-30 02:18 -0700
Re: Problem with ranks jameskuyper@alumni.caltech.edu - 2020-05-30 07:11 -0700
Re: Problem with ranks Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-06-28 05:54 -0700
Re: Problem with ranks James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-05-30 09:04 -0400
Re: Problem with ranks Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-05-30 02:11 -0700
csiph-web