in reply to Re: Checking for leap year
in thread Checking for leap year
sub is_leap { my $y = shift; return 0 if $y % 4; # not multiple of 4 return 1 unless $y % 400; # is multiple of 400 return 0 unless $y % 100; # is multiple of 100 return 1; # everything else }
-- Randal L. Schwartz, Perl hacker
|
|---|