Reply To: The MJD60K problem.

Forums General Discussion The MJD60K problem. Reply To: The MJD60K problem.

#615924
Dr Paul Leyland
Participant

It is not just a matter of storage. For instance, some years ago one of my Perl scripts contained this

    my ($star, $jd, $mag);
    while (<INPUT>) {
        if (/^Variable\s+(.*)/) {
            $star = $1 and next;
        } elsif (/^(245\d+\.\d+)\tV\t(.*?)\t/) {
            ($jd, $mag) = ($1, $2);
            $mag =~ s/\[/</ or $mag = sprintf “%.2f”, $mag;
            my ($year, $month, $day) = jd2gregorian ($jd + 0.5);
            printf “%s\t%.3f\t%s\tLEY\n”, $star, $day, $mag;
        }
    }

Spot the bug.