Bits, Bytes & Binary
Everything in a computer — numbers, text, photos, this webpage — is stored as bits: billions of tiny switches that are either on or off. Learn to count the way the machine does.
A bit is a single 0 or 1. Eight bits make a byte, which can represent 256 different values (2^8). Binary is just place-value counting with 2s instead of 10s: the binary number 1011 means 1×8 + 0×4 + 1×2 + 1×1 = 11. Hexadecimal (base 16, digits 0-9 then a-f) is shorthand — one hex digit is exactly four bits, so 0xFF is 11111111 is 255.
Negative numbers use two's complement: to negate, flip every bit and add one. The top bit acts as the sign. This is why an 8-bit signed integer ranges from -128 to 127, and why integer overflow wraps around to a huge negative number — the bits just carried past the sign position.
Floating point (float/double) stores numbers as sign × fraction × 2^exponent — like scientific notation in binary. 0.1 has no exact binary representation, which is why 0.1 + 0.2 != 0.3 in every language. It's the format (IEEE 754), not the language.