> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/l/leap_year.md).

# Leap year

```perl
func isleap(year) {
    if (year %% 100) {
        return (year %% 400)
    }
    return (year %% 4)
}
```

or a little bit simpler:

```perl
func isleap(year) { year %% 100 ? (year %% 400) : (year %% 4) }
```
