3 ms·
Can someone explain how to read the Conversion Rules section in the second chapter? I haven't seen this style of notation before. For example: Implicit typ
by hecanjog 3y ago
Can someone explain how to read the Conversion Rules section in the second chapter? I haven't seen this style of notation before. For example:
Implicit type conversion rules, applied in order, before any operation: ⊗: any operation (*, +, /, -, %, etc.)
(A) Floating point promotion
floating type ⊗ integer type → floating type
(B) Implicit integer promotion
small integral type := any signed/unsigned integral type smaller than int small integral type ⊗ small integral type → int
(C) Size promotion
small type ⊗ large type → large type
(D) Sign promotion
signed type ⊗ unsigned type → unsigned type
Edit: oops, I missed the explainer. The ⊗ stands in for any operator in case that was confusing to anyone else who missed it. :-)