-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[C++] Division with negative duration types leads to NaN
.
#39156
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
Comments
This was referenced Dec 9, 2023
NaN
.NaN
.
kou
pushed a commit
that referenced
this issue
Dec 10, 2023
### Rationale for this change I forgot to cast durations to doubles in the current `division(duration, duration)` kernel. So they were essentially `reinterpret_cast`ed to double. Because I only tested small positive ints but not large ints or negative ints, I missed this bug. ### What changes are included in this PR? Add a `FloatingDivide` operator that casts ints to doubles and do floating division. Replace the `division(duration, duration)` with this op. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: #39156 Authored-by: Jin Shang <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
mapleFU
pushed a commit
to mapleFU/arrow
that referenced
this issue
Dec 13, 2023
…#39158) ### Rationale for this change I forgot to cast durations to doubles in the current `division(duration, duration)` kernel. So they were essentially `reinterpret_cast`ed to double. Because I only tested small positive ints but not large ints or negative ints, I missed this bug. ### What changes are included in this PR? Add a `FloatingDivide` operator that casts ints to doubles and do floating division. Replace the `division(duration, duration)` with this op. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#39156 Authored-by: Jin Shang <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
clayburn
pushed a commit
to clayburn/arrow
that referenced
this issue
Jan 23, 2024
…#39158) ### Rationale for this change I forgot to cast durations to doubles in the current `division(duration, duration)` kernel. So they were essentially `reinterpret_cast`ed to double. Because I only tested small positive ints but not large ints or negative ints, I missed this bug. ### What changes are included in this PR? Add a `FloatingDivide` operator that casts ints to doubles and do floating division. Replace the `division(duration, duration)` with this op. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#39156 Authored-by: Jin Shang <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this issue
Feb 19, 2024
…#39158) ### Rationale for this change I forgot to cast durations to doubles in the current `division(duration, duration)` kernel. So they were essentially `reinterpret_cast`ed to double. Because I only tested small positive ints but not large ints or negative ints, I missed this bug. ### What changes are included in this PR? Add a `FloatingDivide` operator that casts ints to doubles and do floating division. Replace the `division(duration, duration)` with this op. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#39156 Authored-by: Jin Shang <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug, including details regarding any error messages, version, and platform.
Tested with 14.0.1, first noted here: pandas-dev/pandas#56409
Related:
#36789
Component(s)
Python
The text was updated successfully, but these errors were encountered: