Posts tagged #data
-
How JPEG makes images small
JPEG converts colors, cuts the image into 8x8 blocks, applies a DCT, rounds with a quality-scaled table and packs the result with Huffman coding.
-
How computers store negative numbers
A signed integer spends its first bit on the sign and stores a negative number as 128 minus its size in the other seven bits. This is two's complement.
-
Why 0.1 + 0.2 is not 0.3
Computers store 0.1 as the nearest binary fraction, which is a hair off. Add two such values and the sum prints as 0.30000000000000004.
-
How UTF-8 stores text
UTF-8 writes each character as one to four bytes. The first byte tells a reader how many, so any language fits and ASCII stays small.
-
How a database index works
An index is a sorted structure next to a table. The database searches it instead of reading every row, but it must keep it in sync on every write.
-
How a hash table finds things fast
A hash table turns the key into a number, uses that number as a position in an array, and jumps straight there instead of searching.