It is easy to underestimate the difficulties of using floating-point numbers in programming. This is especially the case in pre-university informatics education and competitions, where one is often led to believe that floating-point arithmetic is a good approximation of the real number system. However, most of the mathematical laws valid for real numbers break down when applied to floating-point numbers. We explain this break-down and illustrate it with four simple examples.
In informatics education and competitions, the students need to be trained, programming assignments need to be formulated, submitted programs need to be evaluated, and variations among computing platforms need to be handled. We show that the use of floating-point numbers gives rise to various kinds of non-trivial difficulties in all these areas. Coping with such difficulties would require that teachers, students, and organizers gain experience in numerical mathematics.
We strongly recommend to avoid the use of floating-point numbers in pre-university education and competitions whenever possible. If you do want to use floating-point numbers, then study the literature of numerical mathematics and be prepared to do a convincing error analysis.