Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP0universalStack: sql
correctnessfloating-pointqueriesdata-modelling
Do not exact-match floating-point columns
Avoid equality comparisons on float/double columns or values; use a tolerance range or a fixed-precision type, since exact matching silently fails to find rows.
PR: vinify-backend · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codesql
| 1 | WHERE volume = 0.75 -- float column, may never match |
Explanation (EN)
Objašnjenje (HR)
Good example
New codesql
| 1 | WHERE ABS(volume - 0.75) < 0.0001 |
| 2 | -- or store volume as DECIMAL and match exactly |
Explanation (EN)
Objašnjenje (HR)