Skip to content
所有標籤

#bitwise-operators

2 篇文章

Stanford CS107 Lecture 4:Bitwise operators、型別轉換與 bitmask

第四講先釐清 signed/unsigned 轉型不改 bits、混合比較可能改變數值意義,以及 sign extension、zero extension、truncation;再推導 AND、OR、NOT、XOR 與 bitmask 的讀取、設定、清除和集合操作。

Stanford CS107 Lecture 5:Bit shifts、bit tricks 與 GDB

第五講把 bitmask 推進到 left/right shift、power-of-two 與 popcount tricks,並用 absolute-value 範例揭示 signed intermediate 在 INT_MIN 會 overflow;後半建立 GDB 的 breakpoint、執行控制、格式化 print、memory examine 與 backtrace 工作流。