package trail.slsb;

import org.jboss.annotation.ejb.LocalBinding;

import javax.ejb.*;

@Stateless
// @LocalBinding (jndiBinding="EJB3Trail/slsb/Calculator")
public class StatelessCalculator implements Calculator {
  
  public double calculate (int start, int end, double growthrate, double saving) {
    double tmp = Math.pow(1. + growthrate / 12., 12. * (end - start) + 1);
    return saving * 12. * (tmp - 1) / growthrate;
  }

}
