NB - you get the same result in MS-SQL (and for exactly the same reason). Ruby behaves like SQL in that appending a decimal to the values results in non-integer maths being employed. MS-SQL itself is slightly out (I…
289/30 = 9 as it's truncating the non-integer part of the operation. So the calculation evaluates to 270 - 120 = 150
NB - you get the same result in MS-SQL (and for exactly the same reason). Ruby behaves like SQL in that appending a decimal to the values results in non-integer maths being employed. MS-SQL itself is slightly out (I…
289/30 = 9 as it's truncating the non-integer part of the operation. So the calculation evaluates to 270 - 120 = 150