I decided to revisit the
problem of computing digits of e
after talking to someone who thought that a spigot algorithm would work without
a loss of precision. I felt pretty embarrassed when it took about 30 seconds to
code that did exactly what I wanted it to.
Then after consulting some documentation to look up the finer points of Bash
syntax, I rewrote it:
And it works! I tested it and compared it to the first several thousand digits that are listed on
and they were identical.
It’s amazing how these problems can initially seem so difficult, but once the
correct approach to the problem is found, the solution is actually quite