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

Rounding error fix on WeightedIndex::update_weights() #956

Merged
merged 1 commit into from Mar 27, 2020

Commits on Mar 26, 2020

  1. Rounding error fix on WeightedIndex::update_weights()

    WeightedIndex::update_weights() uses subtraction on old_w. Rounding errors, particularly on f32, may bring total_weight to below 0. This PR makes sure a negative total_weight results in an error.
    
    This replaces PR rust-random#955 which was invalidated after a merge. Thanks for your consideration!
    facorread committed Mar 26, 2020
    Copy the full SHA
    4679f05 View commit details
    Browse the repository at this point in the history