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

Don't check the DivideByZero error for float modulus #2720

Closed
HaoYang670 opened this issue Sep 13, 2022 · 1 comment
Closed

Don't check the DivideByZero error for float modulus #2720

HaoYang670 opened this issue Sep 13, 2022 · 1 comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@HaoYang670
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

Currently, we check the DivideByZero error for all primitive types in modulus: https://github.com/apache/arrow-rs/blob/master/arrow/src/compute/kernels/arithmetic.rs#L1098

We should remove this checking for float type because %0.0 is a legal operation: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3a34dc3a346d8c3adc845a646d7e9642

Describe the solution you'd like
Remove the DivideByZero checking for float type and add tests

Describe alternatives you've considered
We could not do this but should comment the reason in the docs.

Additional context

@HaoYang670 HaoYang670 added the enhancement Any new improvement worthy of a entry in the changelog label Sep 13, 2022
@HaoYang670
Copy link
Contributor Author

Close this issue as we should follow the c++ impl

@HaoYang670 HaoYang670 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2022
@alamb alamb added the arrow Changes to the arrow crate label Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

No branches or pull requests

2 participants