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

quantile! produces an unrelated assertion error when computing quantiles of a large range #121

Open
yurivish opened this issue Jun 30, 2022 · 0 comments

Comments

@yurivish
Copy link

In an earlier issue @jishnub noticed that certain ranges are considered nonempty despite the fact that their length is zero:

julia> r = typemin(Int):typemax(Int)
-9223372036854775808:9223372036854775807

julia> length(r)
0

julia> isempty(r)
false

This behavior triggers an assertion error in quantile! even though quantiles for such ranges are mathematically well-defined:

julia> using Statistics

julia> quantile!([0], r, [1])
ERROR: AssertionError: n > 0

The assertion has the comment "this case should never happen here":

@assert n > 0 # this case should never happen here

@yurivish yurivish changed the title quantile! produces an error when computing quantiles of a large range quantile! produces an assertion error when computing quantiles of a large range Jun 30, 2022
@yurivish yurivish changed the title quantile! produces an assertion error when computing quantiles of a large range quantile! produces an unrelated assertion error when computing quantiles of a large range Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant