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
Potential For Infinite Loop in Real .polymod Due To Floating Point Math Imprecision #5326
Comments
From @zoffixznetCurrent implementation of .polymod on Reals with lazy list divisors as arguments checks for whether the number operated on is exactly equals to zero before stopping: https://github.com/rakudo/rakudo/blob/51bbf66a34ae8208e6aa8f76347579bd70c34748/src/core/Real.pm#L73 This creates a potential for an infinite loop due to floating point math imprecision that introduces differences between the remained subtracted from the number and the resulting division. I believe the check should be changed from `last if $inf and not $more;` to `last if $inf and $more <= 0;`. Here is an example of the issue: $ perl6 -e 'say 4343434343.Num.polymod: 1/3 xx Inf' |
From @zoffixznetRejecting this. The 1/3 divisor doesn't make sense, as it will be making the original number larger and larger and I can't reproduce any issues with a sane divisor. |
@zoffixznet - Status changed from 'new' to 'rejected' |
Migrated from rt.perl.org#128175 (status was 'rejected')
Searchable as RT128175$
The text was updated successfully, but these errors were encountered: