Potential For Infinite Loop in Real .polymod Due To Floating Point Math Imprecision #5326
Current 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'