Add calculateExponent function
Merge pull request #2 from emmya/master

Add calculateExponent function