One morning in my last year of high school, I started a program to calculate pi to 10,000 digits and went to school. I got home that evening, eager to see the screen. It was still calculating.

The machine was an NEC PC-8001, on which I had learned machine language. As I remember it, I had 8 KB of RAM to work with. Its Z80-compatible processor had no dedicated multiply or divide instruction, so I wrote those routines myself and combined them into routines for arithmetic with many digits. To calculate pi, I used a formula obtained through a Maclaurin expansion.

Going straight to 10,000 digits seemed risky. I made the digit count adjustable, tried 100 digits first, and checked the answer. Then I started the full run.

That night I went to bed wondering when it would finish. Or whether it would finish at all.

The next morning I checked the screen. Still calculating. Had I made a mistake in the program? I went to school again, wondering.

When I got home on the second evening, there was the answer. Ten thousand digits in a little over 26 hours. I’ve forgotten the exact time, but I still remember that it took more than 26 hours.

And finishing the calculation still left me with the printing. To produce 16-by-16-dot characters on an 8-dot printer, I wrote another machine-language routine. Print dots, advance the paper by half a dot, print again, advance again. Over and over.

It felt as though writing them out by hand would be faster. Mind you, I had no intention of writing out 10,000 digits by hand.

Years later, in a 2021 blog post, I wrote down some timings for calculating pi. For an old PC, I wrote “about 34 hours.” I may have included the time to print all 10,000 digits. The old post does not record the test conditions, so I can’t establish whether that was the same run as the one I remember taking a little over 26 hours.

In that same 2021 post, I recorded 34 seconds for the calculation on the AS/400 host. In that same post, I wrote “0 seconds (not measurable)” for a Core i9 PC. “Just how fast is that Core i9?!” I wondered, then started questioning my own program on the host computer. The zero is what I wrote at the time; it doesn’t mean the calculation literally took no time.

The gray-haired author character in a green shirt holds a stopwatch beside a laptop, looking surprised.
AI illustration of the later surprise at a calculation’s speed, not a reconstruction of the PC-8001 or either test.

I still smile at how surprised I was by the faster computer. But the screen the morning after I started that first run is what I remember best. Still calculating. I left it running and went to school. And I can still remember how happy I was to come home and find the answer.

The school-day story is from the author’s recollection. The later account comes from his February 14, 2021 post. The PC-8001 specification is documented by Japan’s National Museum of Nature and Science.

Reference: NEC PC-8001, National Museum of Nature and Science

WRITTEN BYYoshio Taki

IBM i / AS/400 System Engineer