Review
So you think you can count?
7. Binary arithmetic is not exact
Rounding functions and more
Review and practice

Instruction

Oops… Something went wrong. Why did we get such an odd result?

The Weight and Height columns have a REAL data type, which is a floating-point number. The internal representation here is binary arithmetic, which means that not all decimal numbers can be represented exactly. Therefore, any computations are also not performed exactly – as we can see.

What can be done about it? Nothing :) That's the way binary arithmetic works.

If you need exact computations, you have to use the DECIMAL data type. When you deal with money values, you should ALWAYS use the DECIMAL or MONEY data type. Floating point numbers are for "scientific" computations on various measurements, like weight and height.

Exercise

Click Next exercise to continue.