Here are two reasons why floating-point numbers are important:
- Physical measurements are usually expressed in scientific notation,
rounded off to some number of decimal places. Floating-point numbers are the
natural thing to use to represent such measurements.
- Exact integer arithmetic to hundreds of digits takes a lot of time for a
computer to do. It may look fast when you do only one computation, but if the
computer has to do thousands or millions or computations, it starts to add up.
Return to lesson.
Joseph L. Zachary
Department of Computer Science
University of Utah