By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,561 Members | 1,231 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,561 IT Pros & Developers. It's quick & easy.

Std's 6.3- conversion- term rank

P: n/a
Just now I asked a question about signed char and unsigned char. I had the
replay very fast by jens.torring and Tim prince. I post via google so now
goes my thanking replay. (I must be more precise according to jens.torring's
replay)

As I was reading the slandered draft C99 about the conversion (6.3)
I have interpreted the word conversion rank as the range of a variable
(as per defined in limits.h). Am I wrong in my understanding?

(I went through FAQ and I don't find the correct spot)
Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 25 Jul 2004 09:48:42 -0700, da***********@yahoo.com wrote in
comp.lang.c:
Just now I asked a question about signed char and unsigned char. I had the
replay very fast by jens.torring and Tim prince. I post via google so now
goes my thanking replay. (I must be more precise according to jens.torring's
replay)

As I was reading the slandered draft C99 about the conversion (6.3) ^^^^^^^^^

Slandered?
I have interpreted the word conversion rank as the range of a variable
(as per defined in limits.h). Am I wrong in my understanding?

(I went through FAQ and I don't find the correct spot)


No, the conversion rank has nothing at all to do with the range of a
type.

It specifically says this in the actual standard:

"The rank of 'long long int' shall be greater than the rank of 'long
int', which shall be greater than the rank of 'int', which shall be
greater than the rank of 'short int', which shall be greater than the
rank of 'signed char'."

It cannot be by range of values, because it is quite common for two or
more different integer types to have the same bit-width and value
range on many implementations.

On 16-bit implementations, short and int usually have the same range.

On today's common 32-bit desk-top systems, int and long usually have
the same range.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #2

P: n/a
"Jack Klein" <ja*******@spamcop.net> wrote in message
news:5h********************************@4ax.com...
On 25 Jul 2004 09:48:42 -0700, da***********@yahoo.com wrote in
comp.lang.c:
Just now I asked a question about signed char and unsigned char. I had the replay very fast by jens.torring and Tim prince. I post via google so now goes my thanking replay. (I must be more precise according to jens.torring's replay)

As I was reading the slandered draft C99 about the conversion (6.3) ^^^^^^^^^
Slandered?
I have interpreted the word conversion rank as the range of a variable (as per defined in limits.h). Am I wrong in my understanding?

(I went through FAQ and I don't find the correct spot)


No, the conversion rank has nothing at all to do with the range of a
type.


Nothing at all?!
It specifically says this in the actual standard:

"The rank of 'long long int' shall be greater than the rank of 'long
int', which shall be greater than the rank of 'int', which shall be
greater than the rank of 'short int', which shall be greater than the
rank of 'signed char'."


The sentence before that is...

- The rank of a signed integer type shall be greater than the rank
of any signed integer type with less precision.

Later, 6.2.5p8 says...

For any two integer types with the same signedness and different
integer conversion rank (see 6.3.1.1), the range of values of the
type with smaller integer conversion rank is a subrange of the
values of the other type.

The concepts of range and rank are inextricably linked.

--
Peter
Nov 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.