(Latest Revision: 04/19/2008)

Tips On Making The Table

When working with "real" numbers you have to keep in mind problems like underflow and overflow.

When I calculate the numbers for the table I am careful about the fact that the formula for the frequency:


can result in numbers that are very close to zero, and therefore very incorrect values can be created by the hardware of the computer.

To guard against error, I use "double" for the data type of all non-integers (like alpha and the frequency above). Also since what I really need to print in the table is the product of the frequency times the table size, I multiply times the table size "early" to avoid underflow. An example may illustrate:

Working like that helps you stay away from really tiny values of the predicted frequency function that could cause underflow.

If you are having problems with your table display, then maybe some of these ideas will help.