Merge pull request #42020 from canhld94/ch_canh_fix_rankcorr

Fix rankCorr size overflow
This commit is contained in:
Nikolay Degterinsky 2022-10-05 09:19:57 +02:00 committed by GitHub
commit 85e4311127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -32,7 +32,7 @@ struct RankCorrelationData : public StatisticalSample<Float64, Float64>
std::tie(ranks_y, std::ignore) = computeRanksAndTieCorrection(this->y);
/// Sizes can be non-equal due to skipped NaNs.
const auto size = std::min(this->size_x, this->size_y);
const Float64 size = static_cast<Float64>(std::min(this->size_x, this->size_y));
/// Count d^2 sum
Float64 answer = 0;

View File

@ -0,0 +1 @@
SELECT round(rankCorr(number, -number)) FROM numbers(5000000);