-
Notifications
You must be signed in to change notification settings - Fork 933
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
Fix inaccurate ceil/floor and inaccurate rescaling casts of fixed-point values. #14242
Changes from all commits
35f213c
4e08fff
febf2d9
c595da2
1fc7fb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2019-2022, NVIDIA CORPORATION. | ||
* Copyright (c) 2019-2023, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -295,7 +295,11 @@ std::unique_ptr<column> unary_op_with(column_view const& input, | |
input.type(), input.size(), copy_bitmask(input, stream, mr), input.null_count(), stream, mr); | ||
|
||
auto out_view = result->mutable_view(); | ||
Type const n = std::pow(10, -input.type().scale()); | ||
|
||
Type n = 10; | ||
for (int i = 1; i < -input.type().scale(); ++i) { | ||
n *= 10; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to worry about overflow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I don't think so. We know that the value |
||
} | ||
|
||
thrust::transform(rmm::exec_policy(stream), | ||
input.begin<Type>(), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the next step to consolidate this logic into a single function somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. See #14243.