Floating-point arithmetic represents real-number values approximately, so exact equality can surprise you. That matters when storing measurements such as meteor coordinates in relational databases. section 12.1.1 section 12.1.2
A comparison that fails
The expressions 0.1 + 0.1 == 0.2 and 0.1 + 0.2 == 0.3 produce different results: the first is True, while the second is False. Strict equality is available, but should not automatically be treated as meaningful for floating-point values. section 12.1.2
Use floating-point fields deliberately when designing persistent data:
- Store measurements such as azimuth and altitude with FLOAT-compatible database fields, while keeping database types separate from domain types. section 12.1.1
- Avoid using floating-point values in primary keys because rounding makes exact values uncertain and equality-based lookup unreliable. section 12.1.2
- Prefer a surrogate key when records need stable identification, rather than combining several measurement fields into a natural key. section 12.1.2



















