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

Quick question about casting day, month and year #758

Open
QuantDevHacks opened this issue Nov 8, 2022 · 1 comment
Open

Quick question about casting day, month and year #758

QuantDevHacks opened this issue Nov 8, 2022 · 1 comment

Comments

@QuantDevHacks
Copy link

Quick question:

Might you tell me the reasoning behind day and month types being cast to unsigned, while year types are cast to int?

Thanks in advance.

@HowardHinnant
Copy link
Owner

The rationale was simply to enforce that negative integral values for month are never represented (ditto for day), while they are for year. It was realized that this design choice had a small cost in terms of homogeneity. And that was weighed against the small benefit of enforcing lack of negative values for month and day. I recognized this as a small-cost / small-benefit design decision and landed with where it is today.

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