Q&A
The output of the Interest program looks sloppy. How do I control how many digits are displayed?
The easiest way to control the number of decimal digits is to use the printf function, which is covered in Hour 9, "More Functions and Operators."
Does Perl have a function for rounding?
The printf function usually does what you want for rounding when displaying numbers. If you really need the round function, check out the POSIX module, which has this function and many more.
How large (or small) of a number will Perl let me manipulate?
The answer depends on your operating system. A typical Intel Unix system's double-precision floating-point numbers can have more than 300 places in the exponent. This means you can manipulate numbers with 300 zeros to the right (or left) of the decimal point. Typically, however, large numbers have only 14 digits of precision.