public static double exp(double x) {
        double x_acc = 1;
        double div = 1;

        double res = 0;
        while (Math.abs(x_acc) > EPS) {
            res = res + x_acc;

            x_acc *= x;
            x_acc /= div;
            div++;
        }
        return res;
    }
Rounds to keep <em>precision</em> decimals. Rounds towards even numbers.
@param x the number to round
@param precision the precision to round to. A precision of 3 will for instance round 1.65432 to 1.654
@return the rounded number
main/src/main/java/cgeo/geocaching/wherigo/kahlua/stdlib/MathLib.java