public static long checksum(final Value value, final boolean iterative) {
        final long cs = letterValue(value.getAsString());
        final boolean negate = value.getAsString().trim().startsWith("-");
        if (!iterative || cs == 0) {
            return negate ? -cs : cs;
        }
        //iterative
        final long itCs = cs % 9;
        return itCs == 0 ? (negate ? -9 : 9) : (negate ? -itCs : itCs);
    }
Holds implementations for functions in Formula
main/src/main/java/cgeo/geocaching/utils/formulas/FormulaUtils.java