-
Notifications
You must be signed in to change notification settings - Fork 555
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
Problem with modulo division with "use integer" #202
Comments
From sbeck@cise.ufl.edu#!/usr/local/bin/perl -w $d = -1 % 7; use integer; $d = -1 % 7; In all cases, it gives the output 6 The first result is correct. The man page says that the operator is not as well defined for negative I've included the "perl -V" info for Solaris 2.6 below, but I doubt Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: ---------------------------- Sullivan Beck ----------------------------- |
From @rspierFrom the 'old bug patrol'.... It doesn't seem that there is a good, fast, and platform independent There are several bugs in the DB related to this: Here's a patch (against perl-current) which adds a warning. [below] The warning probably isn't the best solution - but there probably There is also a fallback in pp_modulo, for UV's which ends up doing -R [rspier@speed perl-current]$ diff -pc pp.c.orig pp.c |
From @gsarOn Sun, 08 Oct 2000 20:14:40 EDT, Robert Spier wrote:
Putting the cheaper test will be more efficient in such cases: if ((left < 0 || right < 0) && ckWARN(WARN_PORTABLE))
Given that what it is warning about is what it has been documented to Sarathy |
From @rspierGS> Putting the cheaper test will be more efficient in such cases: Oops. Changed. GS> Given that what it is warning about is what it has been documented I agree with that. But also - there have been a few bug reports on this subject, and I think the warning is harmless - and might encourage people to "do If the warning annoys people - they should be using 'no warnings If your opinion is still No, I'll close the bug and note that "It's -R |
From The RT System itselfFunctionality is documented to work this way. The "bug" is in the definition of the C standard for %. |
Migrated from rt.perl.org#1008 (status was 'resolved')
Searchable as RT1008$
The text was updated successfully, but these errors were encountered: