Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Subtracting Stringified Negative Numbers

by agianni (Hermit)
on Jun 22, 2007 at 04:28 UTC ( #622710=note: print w/replies, xml ) Need Help??


in reply to Subtracting Stringified Negative Numbers

Hmmm... when I tried your code it worked just fine and $dif had the value of 106. What version of Perl are you using? What is the actual context of the code?

Not knowing the context, you might consider doing something like:

my $dif = ( int $n1 ) - ( int $n2 );
to force the strings into integers. But I'm thinking there's something else going on. Additional context would definitely help.

perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://622710]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2017-12-13 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (344 votes). Check out past polls.

    Notices?