The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Friday, November 12, 2004

100,000 digits of e

In case you were wondering about the title to my little PHP rant the other day, it's e, the mathematical constant dealing with natural logarithms, out to 20 decimal places. I felt that was a good place to break it as any.

I got the value from a program I wrote, oh, it looks to be around 1995 or so, and was based upon a program written by Steve Wozniak for the Apple ][ computer, and documented in a Byte Magazine article from December 1980 (I think—the copy of the article is buried somewhere around here, but the timeframe is close enough to track down the article if you are truely interested). Written in 6502 Assembly and it calculated e out to 100,000 digits (no more since there was no more memory in the Apple ][ to hold the result). By following the article and the 6502 Assembly code, I was able to rewrite it in C.

Now, when Steve Wozniak first wrote it, it took the Apple ][ a week to calculate the result—a modern machine (okay, a 1.6GHz AMD Athalon) took only 2½ minutes to calculate e to 100,000 digits (the output give the amount of memory used, the number of digits produced (and in this case, 50,000 bytes gives 120,412 digits) and the magnitude of the result and the resultant number itself, but without the leading 2).

Amazing the speed advances that 24 years can bring.

As for how the program works, you'll have to dig up the article and find out; I don't recall the math behind it anymore.

Obligatory Picture

[“I am NOT a number, I am … a Q-CODE!”]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site:, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.