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

Issues with %/% and %% and division by 0 #349

Closed
DavisVaughan opened this issue May 11, 2023 · 0 comments · Fixed by #350
Closed

Issues with %/% and %% and division by 0 #349

DavisVaughan opened this issue May 11, 2023 · 0 comments · Fixed by #350

Comments

@DavisVaughan
Copy link
Member

duration_years(5) %/% 0
duration_years(5) %/% duration_years(0)

duration_years(5) %% 0
duration_years(5) %% duration_years(0)

These are all undefined C++ behavior and crash the session, but we should return missing values

In particular we should be consistent with 2L %/% 0L = NA rather than 2 %/% 0 = Inf since infinite durations are not supported

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

Successfully merging a pull request may close this issue.

1 participant