Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Underlying type balancing for integral operands
#1
From "Underlying type balancing" on page 57:

Quote:Otherwise, if both operands have integral type, the underlying type of the expression can be found using the following:
– If the types of the operands are the same size, and either is unsigned, the result is unsigned.
– Otherwise, the type of the result is that of the larger type.

1. Does "the types of the operands" refer to underlying type or actual type?

2. Does "and either is unsigned" mean "and either is an unsigned integral type" or "and either is the type unsigned [int]"?

3. What is the intended meaning of "the result is unsigned" in the first bullet? A literal reading might suggest that the result is simply unsigned, i.e. the type unsigned int. I do not think this is the intended behavior. I assume it was meant to have the effect as if it said "the result is the [underlying?] type of the unsigned operand(s)".

4. Does "that of the larger type" refer to underlying type or actual type?
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)