Casio CFX-9800G

The CFX-9800G is a recent member of Casio's line of color graphing calculators. It is a "do-everything" calculator in the same league as the Hewlett-Packard HP-48SX.

Or perhaps not quite in the same league. The color display of the CFX-9800G is truly impressive, but its operating paradigm is much less sophisticated. Different data types and areas of functionality are not well integrated. For instance, trigonometric and transcendental functions are not defined for complex arguments, or arguments that would yield complex results. It also appears impossible to create a graph from the results of a user-defined program(not a function.)

The listing below is a program that calculates the Gamma function for any real argument (it would work for complex arguments as well, were it not for the lack of complex support in the built-in exponential and logarithmic functions.) This program, I believe, can be used in unaltered form on many Casio calculators and clones.