private static int ldexp(LuaCallFrame callFrame, int nArguments) {
        BaseLib.luaAssert(nArguments >= 2, "Not enough arguments");
        double m = getDoubleArg(callFrame,1,names[LDEXP]);
        double dE = getDoubleArg(callFrame,2,names[LDEXP]);

        double ret;
        double tmp = m + dE;
        if (Double.isInfinite(tmp) || Double.isNaN(tmp)) {
            ret = m;
        } else {
            int e = (int) dE;
            ret = m * (1 << e);
        }

        callFrame.push(LuaState.toDouble(ret));
        return 1;
    }
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