Fixed calculate method in exp function