A small class to generate the mathematical constant “e”. Complete with timer and digits per second clock. Unpolished. Here’s a quick benchmark and you can see that it doesn’t scale.

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

 * calculate mathmatical constant e

public class ECalculator {
  private static final int numberOfDigits = 1000;
  public static void main(String[] args) {
    ECalculator myEClass = new ECalculator();
    System.out.println("Calculating e to " + numberOfDigits + " digits ...\n");
    Date start = new Date();
    BigDecimal e = myEClass.doCalculation();
    Date stop = new Date();
    long elapsedSeconds = (stop.getTime()-start.getTime()) / 1000;
    System.out.println("e is: \n" + e);
    if (elapsedSeconds