public mjDate Djcal(double djm) throws palError {
        double fd, df, f, d;
        long jd, n4, nd10;
        int yr, mn, dy;
        Status = 0;

        TRACE("Djcal");
        /* Validate */
        if ((djm <= -2395520.0) || (djm >= 1.0e9)) {
            Status = -1;
            throw new palError(Status, "Djcal: Date out of Range");
        } else {

            /* Separate day and fraction */
            d = Math.floor(djm);
            f = djm - d;
            if (f < 0.0) {
                f += 1.0;
            }

            /* Express day in Gregorian calendar */
            jd = (long) dnint(d) + 2400001L;
            n4 = 4L * (jd + ((2L * ((4L * jd - 17918L) / 146097L) * 3L) / 4L + 1L) / 2L - 37L);
            nd10 = 10L * (((n4 - 237L) % 1461L) / 4L) + 5L;
            yr = (int) ((n4 / 1461L) - 4712L);
            mn = (int) (((nd10 / 306L + 2L) % 12L) + 1L);
            dy = (int) ((nd10 % 306L) / 10L + 1L);
        }
        ENDTRACE("Djcal");
        try {
            mjDate date = new mjDate(yr, mn, dy, f);
            return date;
        } catch (palError e) {
            throw e;
        }
    }