Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Whole chapter 4 talks about conversions, but I think you should be mostly interested in these :</p> <p><strong>4.5 Integral promotions</strong> [conv.prom]<br> An rvalue of type char, signed char, unsigned char, short int, or unsigned short int can be converted to an rvalue of type int if int can represent all the values of the source type; other-<br> wise, the source rvalue can be converted to an rvalue of type unsigned int.<br> An rvalue of type wchar_t (3.9.1) or an enumeration type (7.2) can be converted to an rvalue of the first<br> of the following types that can represent all the values of its underlying type: int, unsigned int,<br> long, or unsigned long.<br> An rvalue for an integral bit-field (9.6) can be converted to an rvalue of type int if int can represent all<br> the values of the bit-field; otherwise, it can be converted to unsigned int if unsigned int can rep-<br> resent all the values of the bit-field. If the bit-field is larger yet, no integral promotion applies to it. If the<br> bit-field has an enumerated type, it is treated as any other value of that type for promotion purposes.<br> An rvalue of type bool can be converted to an rvalue of type int, with false becoming zero and true<br> becoming one.<br> These conversions are called integral promotions. </p> <p><strong>4.6 Floating point promotion</strong> [conv.fpprom]<br> An rvalue of type float can be converted to an rvalue of type double. The value is unchanged.<br> This conversion is called floating point promotion. </p> <p>Therefore, all conversions involving float - the result is float.</p> <p>Only the one involving both int - the result is int : int / int = int</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload