The numbers tool

A lot can be learned about what a program does by looking at the numeric literals contained in its source code. The numbers program extracts these literals, compares them against a database of 'interesting' values and prints out any matches; it can also print out values that don't match.

The two most important aspects of this process are:

Hopefullly users will add their own set of interesting values to the database.

I have various ideas for reducing matches that occur for 'uninteresting' reasons.


The software is known to build under Linux (or at least Suse 10.3) and Mac OS X (i.e., success with 10.5.7 with gcc i686-apple-darwin9-gcc-4.0.1 has been reported). All sources are available for download under a GPL license.

Current version (29 Mar 13): numbers-0.5.tgz



Numbers wiki

The software will make use the multiple-precision GMP library if it is available, to support larger number with more precision than the host floating-point hardware. Otherwise the host compiler long double type is used.

Support tools

The tools used to calculate the values of some constants were bc, calc (a C-style arbitrary precision calculator) and dc

Analysis of numbers output

Results from analysing the output of numbers when run over various code bases.

Variations in the literal representation of Pi.

Suggestions and comments welcome

derek "at" coding-guidelines dot com

Last updated