public static double asin(double arg)
    {
        double temp;
        int sign;

        sign = 0;
        if(arg < 0)
        {
        arg = -arg;
        sign++;
        }
        if(arg > 1) {
            return Double.NaN;
        }
        temp = Math.sqrt(1 - arg*arg);
        if(arg > 0.7) {
            temp = PIO2 - atan(temp/arg);
        } else {
            temp = atan(arg/temp);
        }
        if(sign > 0) {
            temp = -temp;
        }
        return temp;
    }
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