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 bug in BlistList for two ranges that could lead to wrong results #3689

Merged
merged 1 commit into from
Oct 6, 2019

Commits on Oct 6, 2019

  1. Fix BlistList for two ranges

    Several results were wrong, and had been wrong since at least GAP 4.4.
    E.g. before this commit:
    
        gap> BlistList([0..3], [-3..-1]);
        [ true, true, true, false ]
    
    Now we get the correct result
    
        gap> BlistList([0,1,2,3], [-3..-1]);
        [ false, false, false, false ]
    
    One major issue was the use of unsigned variables to store signed data. Two
    variables were only of type `long` instead of `Int`, but on 64bit, this could
    lead to further issues.
    
    The logic handling the intersection was broken and overly complicated. The
    rewritten logic should be simpler.
    
    Finally, there is a tiny optimization enabled by switching from 1-based
    indexing to 0-based.
    fingolfin committed Oct 6, 2019
    Configuration menu
    Copy the full SHA
    1247ce7 View commit details
    Browse the repository at this point in the history