-
Notifications
You must be signed in to change notification settings - Fork 577
Definition of % operator may be wrong for negative divisors #16339
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
Comments
From @jimavThis is a bug report for perl from jim.avera@gmail.com, Hello, The documentation of the '%' operator for negative divisors seems "If $n is negative, then "$m % $n" is $m minus the smallest multiple For example 91 % -10 = -9 ; instantiating $m = 91 and $n = -10 produces "91 % -10 is 91 minus the smallest multiple of -10 that is not less than 91" which is impossible, since no multiple of a negative number is >= a positive. My _guess_ is that a correct definitin is: "If $n is negative, then "$m % $n" is $m plus the largest multiple That works for the examples I've tried, including the one abive where Someone who knows this deeply should fix the definition in perlop. Flags: Site configuration information for perl 5.26.0: Configured by Debian Project at Fri Sep 15 16:13:42 UTC 2017. Summary of my perl5 (revision 5 version 26 subversion 0) configuration: Locally applied patches: @INC for perl 5.26.0: Environment for perl 5.26.0: |
From [email protected]via RT wrote:
Multiples that arise from multiplying by a negative integer count.
That would be less clear. "Largest" isn't a synonym for "greatest", The documentation is fine as it is. -zefram |
The RT System itself - Status changed from 'new' to 'open' |
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#132649 (status was 'rejected')
Searchable as RT132649$
The text was updated successfully, but these errors were encountered: