-
Notifications
You must be signed in to change notification settings - Fork 576
-'-10' eq '+10' #8045
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 pfusik@op.plThis is a bug report for perl from pfusik@op.pl, The behavior of the unary minus operator is inconsistent between perl -le 'print for -"10",-"10.0",-"10foo",-"-10",-"-10.0",-"-10foo",-" -10",-" -10.0",-" -10foo"' Perl guesses whether the argument of '-' is a number. Flags: Site configuration information for perl v5.8.7: Configured by ActiveState at Sat Jun 4 07:30:27 PDT 2005. Summary of my perl5 (revision 5 version 8 subversion 7) configuration: config_args='-ders -Dcc=gcc -Dusethreads -Duseithreads -Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Accflags=-DUSE_S cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -DBUILT_BY_ACTIVESTATE -fno-strict-alias Locally applied patches: @INC for perl v5.8.7: Environment for perl v5.8.7: |
From @smpeters
Let's see what Scalar::Util::looks_like_number() says... steve@kirk:~/perl-current$ perl -MScalar::Util=looks_like_number -
Perl certainly does treat them like numbers when they appear to be |
The RT System itself - Status changed from 'new' to 'open' |
@smpeters - Status changed from 'open' to 'resolved' |
From BQW10602@nifty.com
It is documented in perlop.pod that unary minus opposes the sign Unary ``-'' cf. PP(pp_negate) I think the case of (-'-10' eq '+10') is conformable Regards, |
From @smpeters
No, its not. The following change fixes this. Also, much of the string Change 26387 by stevep@stevep-mccoy on 2005/12/17 15:35:45 Addition documentation explaining aritmetic negation on strings. Also, Affected files ... ... //depot/perl/pod/perlop.pod#136 edit Differences ... ==== //depot/perl/pod/perlop.pod#136 (text) ==== @@ -199,7 +199,11 @@ Unary "~" performs bitwise negation, i.e., 1's complement. For |
From @smpeters
Errr... a bit clearer is Change 26388 by stevep@stevep-mccoy on 2005/12/17 15:41:38 Fix a typo and add some clarification to change #26387. Affected files ... ... //depot/perl/pod/perlop.pod#137 edit Differences ... ==== //depot/perl/pod/perlop.pod#137 (text) ==== @@ -200,10 +200,10 @@ Unary "~" performs bitwise negation, i.e., 1's complement. For |
From @tamiasOn Sat, Dec 17, 2005 at 07:42:49AM -0800, Steve Peters via RT wrote:
Nits: "exluding" should be "excluding"; "numeric" is an adjective, not a Ronald |
Migrated from rt.perl.org#36675 (status was 'resolved')
Searchable as RT36675$
The text was updated successfully, but these errors were encountered: