Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date.is_leap_day seems wrong #22

Open
twopir opened this issue Apr 8, 2019 · 2 comments
Open

Date.is_leap_day seems wrong #22

twopir opened this issue Apr 8, 2019 · 2 comments

Comments

@twopir
Copy link

twopir commented Apr 8, 2019

utop [21]: Date.is_leap_year 2000;;
- : bool = true
utop [22]: Date.is_leap_day (Date.make 2000 2 29);;
- : bool = false

is_leap_year (year d) && month d = Feb && day_of_month d = 24

This seems to just be defined incorrectly.

@twopir
Copy link
Author

twopir commented Apr 8, 2019

Or I could read the FAQ — sorry!

It is 24 February!

@twopir twopir closed this as completed Apr 8, 2019
@Drup Drup reopened this Apr 8, 2019
@Drup
Copy link
Member

Drup commented Apr 8, 2019

The behavior may be correct, but it should be explained in the documentation of the function, not lost in the FAQ that most people don't know exist. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants