為什麼在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