i
Integers vs Floats daniel-hromada ()


Integers vs Floats

Integer formats store whole numbers exactly. int8: one byte, 256 distinct values — typically -128 to 127.

Floating-point formats trade some of that exactness for enormous range: a sign bit, an exponent, and a mantissa (the significant digits) — the same idea as scientific notation, just in binary.

More bits generally buys you more precision, more range, or both. Fewer bits buys you speed and memory — at a cost.