summaryrefslogtreecommitdiff
path: root/go/leap/leap.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-08-25 03:13:39 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-08-25 03:13:39 +0200
commit509c5063d66e8bbef4ec1def1c99c318be51aceb (patch)
treeafc811c4781a4e317043e2a0237499defc168044 /go/leap/leap.go
Initial import
Diffstat (limited to 'go/leap/leap.go')
-rw-r--r--go/leap/leap.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/go/leap/leap.go b/go/leap/leap.go
new file mode 100644
index 0000000..75908eb
--- /dev/null
+++ b/go/leap/leap.go
@@ -0,0 +1,8 @@
+package leap
+
+const testVersion = 2
+
+// IsLeapYear reports if it year is a leap year
+func IsLeapYear(y int) bool {
+ return y%4 == 0 && y%100 != 0 || y%400 == 0
+}