fix rankcorr size overflow

This commit is contained in:
Duc Canh Le 2022-10-03 19:55:37 +08:00
parent 298ad5d6d3
commit 34f598e09b
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 Float32 size = static_cast<Float32>(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);