public double Cldj(int iy, int im, int id) throws palError {
        long iyL, imL;

        /* Month lengths in days */
        final int mtab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

        TRACE("Cldj");

        /* Validate year */
        if (iy < -4699) {
            Status = 1;
            throw new palError(Status, "Cldj: Bad Year");
        }

        /* Validate month */
        if ((im < 1) || (im > 12)) {
            Status = 2;
            throw new palError(Status, "Cldj: Bad Month");
        }

        /* Allow for leap year */
        mtab[1] = (((iy % 4) == 0) && (((iy % 100) != 0) || ((iy % 400) == 0))) ? 29 : 28;

        /* Validate day */
        if (id < 1 || id > mtab[im - 1]) {
            Status = 3;
            throw new palError(Status, "Cldj: Bad Day");
        }

        /* Lengthen year and month numbers to avoid overflow */
        iyL = iy;
        imL = im;

        ENDTRACE("Cldj");
        /* Perform the conversion */
        return ((1461L * (iyL - (12L - imL) / 10L + 4712L)) / 4L + (306L * ((imL + 9L) % 12L) + 5L) / 10L
                        - (3L * ((iyL - (12L - imL) / 10L + 4900L) / 100L)) / 4L + id - 2399904L);
    }