←
🏠 Trang chính
/
DataFoundations
Nhóm 1 — Number & Bit Representation
Cách máy lưu
số
: binary/hex, bitwise operations, IEEE 754 floating-point.
Nhóm này dạy gì?
Hệ binary/hex, two's complement, tại sao
int8
có range −128 đến 127.
6 phép bitwise + bitmask trick (
x & -x
isolate LSB,
x & (x-1)
clear LSB, popcount Brian Kernighan).
IEEE 754 floating-point: sign + exponent + mantissa; vì sao
0.1 + 0.2 ≠ 0.3
; NaN, ±Inf, denormal.
Lộ trình
3 bài — học tuần tự
Lesson 01
Binary & Hex
Hệ cơ số 2/16, chuyển đổi, two's complement, kích thước intN, overflow.
▶ Visualization
Lesson 02
Bitwise Operations
AND/OR/XOR/NOT/shift, bitmask, popcount,
x & -x
, liệt kê tập con bằng bitmask.
▶ Visualization
Lesson 03
Floating-point IEEE 754
Sign/exponent/mantissa; NaN, ±Inf, denormal; precision pitfalls (0.1+0.2≠0.3); double vs float.
▶ Visualization