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

Fix sample with wide integer types #873

Merged
merged 3 commits into from Jul 5, 2023
Merged

Fix sample with wide integer types #873

merged 3 commits into from Jul 5, 2023

Conversation

ararslan
Copy link
Member

As observed in #872, an unordered sample without replacement with a type 64 bits or wider (notably excluding Int64, at least on a 64-bit system) hits a MethodError in samplepair, which had been restricted to Int inputs. Relaxing this restriction and adjusting the samplepair implementation accordingly allows these cases to succeed.

Fixes #872.

As observed in issue 872, an unordered sample without replacement with a
type 64 bits or wider (notably excluding `Int64`, at least on a 64-bit
system) hits a `MethodError` in `samplepair`, which had been restricted
to `Int` inputs. Relaxing this restriction and adjusting the
`samplepair` implementation accordingly allows these cases to succeed.
@ararslan ararslan requested a review from nalimilan June 30, 2023 23:13
test/sampling.jl Outdated Show resolved Hide resolved
test/sampling.jl Outdated Show resolved Hide resolved
src/sampling.jl Outdated Show resolved Hide resolved
test/sampling.jl Outdated Show resolved Hide resolved
Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ararslan ararslan merged commit e85e008 into master Jul 5, 2023
17 of 18 checks passed
@ararslan ararslan deleted the aa/fix-872 branch July 5, 2023 16:01
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

Successfully merging this pull request may close these issues.

sample throws error when used on UInt64
3 participants