Sha256: b5d10e52cfb75bf7b858d65c3fcad72e246069336fc93edba4205cf603b3a7b1
Contents?: true
Size: 326 Bytes
Versions: 47
Compression:
Stored size: 326 Bytes
Contents
# Declare package 'Leap' with version package Leap 3; use strict; use warnings; use Exporter 'import'; our @EXPORT_OK = qw(is_leap); sub is_leap { my $year = shift; divisible_by($year, 400) or divisible_by($year, 4) and !divisible_by($year, 100) ? 1 : 0; } sub divisible_by { $_[0] % $_[1] == 0 ? 1 : 0; } 1;
Version data entries
47 entries across 47 versions & 1 rubygems