float & real (data type)
data type float & real
What changes
- Input
- none
- Output or change
- none
Syntax at a glance
float [ ( n ) ] | real
Work example
Store scientific measurements where an approximate binary value is acceptable.
Use a tolerance for comparisons and use decimal for exact decimal business rules.
Check your work float and real are approximate, so equality checks can fail after arithmetic.
Practice SQL
Open in SQL FlowSELECT CAST(0.1 AS float) + CAST(0.2 AS float) AS approximate_sum;
Open Microsoft Learn for full syntax, permissions, and details for your version.