IEEE 754 float double.
36.3 , double, '36.29999923706055' 6.3 → '6.300000190734863'
You can convert here Link 1 or Link 2
Now the result col_a - col_b - col_cis '29 .99999904632569 '. Now you have applied the floor on it, which will give you the result "29"
FLOOR () returns the largest integer value that does not exceed the number specified as an argument.
floor (col_a - col_b - col_c)
Returns the output field (29.99999904632569), which gives you the answer → 29
As Tim said, you should use the decimal type or use the query below.
SELECT FLOOR(36.3- 0 -6.3),(col_a - col_b - col_c)
AS calc, col_a, col_b, col_c
FROM table_name LIMIT 1;
Output: 30
source
share