Watch
Floating Point Numbers - Computerphile
Explains why binary floating point cannot represent 0.1 exactly and why it should not be used for money.
Engineering Fundamentals for the Agent Era
Contents Section 3, The Machine
Money stored and calculated as floating-point numbers, producing totals that are off by a cent.
String truncation or length checks that count bytes or code units and split an emoji or accented character in half.
Timestamps saved without a time zone, so events shift by hours when a server moves region or the clocks change.
Large integer IDs silently rounded when parsed as floating-point JSON numbers.
How computers store integers, decimals, text and timestamps, and the silent errors each representation invites.
An agent wrote an invoice function that sums line items as floating-point numbers and accepts a payment only when the amount paid is exactly equal to that sum, and it stores the due date as a local-time string with no zone. Show why three line items of 0.10 produce a total that rejects a payment of 0.30, then find a customer location that sees the wrong due date.
Watch
Explains why binary floating point cannot represent 0.1 exactly and why it should not be used for money.
Tours time zones, daylight saving changes, leap seconds and calendar changes to show why time should be stored in UTC and handled by a maintained library.
Traces text from ASCII through code pages to Unicode and UTF-8, covering encodings, combining characters and why string length is ambiguous.
Builds up from bits and binary to integers, two's complement, character encoding and floating point, explaining why each representation has the limits it does.
Its chapter on encoding compares JSON, Protocol Buffers and Avro, including numbers above 2^53 losing precision in JSON and schema evolution across service boundaries.
Paper
The definitive paper on IEEE 754 rounding error, relative error and why results differ from decimal arithmetic.
RFC
Section 6 warns that implementations commonly parse numbers as IEEE 754 doubles, so integers outside [-(2**53)+1, (2**53)-1] lose precision, which is the large-ID catch.