gcc a.c -O3 -Wall q.s; ./a.outClang OK.

Theory: Array e[sz] represents a number x between 0 and 1. 0≤x<1 and x = Σ[n>0]2

To print decimal value of x, each iteration of the outer loop
prints the integral part of 10^{13}x as a decimal numeral and
replaces x by (10^{13}x) mod 1.
There is nothing magic about 13 except that 0<13<20.

See this about addq, divq and mulq. In 1957 IBM 704 machine code, to compute e in binary, without decimal printout or accuracy estimate, fit on one punched card of 22 instructions.