为什么在C和C?
的背景在C中,Integer促销是在表达式中自动转换的,以确定数据类型在表达式中自动转换。适用于算术表达式的通常的算术转换涉及将其促进到INT,如果它可以代表所有简短值。 Otherwise, it is promoted to unsigned int.
Rationale for Wider CalculationsAccording to the C standard rationale, allowing calculations in wider types than necessary was introduced to:
Generate smaller and faster codeProvide more accurate resultsThis design decision is attributed to the varying hardware architectures at the time, where using wider types could result in more efficient code execution.
Implications for Short Operands免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3