Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: to convert 16 dig hex to dec

by haoess (Curate)
on Sep 01, 2005 at 10:15 UTC ( [id://488338]=note: print w/replies, xml ) Need Help??


in reply to to convert 16 dig hex to dec

print hex $value;

Update: Nevermind this throws a warning:

Integer overflow in hexadecimal number

A way without warnings:

perl -Mbigint -wle 'print 0x9DBE062CB1F34287'

Please, please have a look at the documentation search engine.

-- Frank

Replies are listed 'Best First'.
Re^2: to convert 16 dig hex to dec
by QM (Parson) on Sep 01, 2005 at 15:41 UTC
    perl -Mbigint -wle 'print 0x9DBE062CB1F34287'
    Shouldn't that be:
    perl -MMath::Bigint -wle 'print 0x9DBE062CB1F34287'
    or is there some new namespace I'm not aware of?

    Update: I didn't look carefully enough. And I was cross-pollinated with:

    perl -MMath::Bigint -wle 'print Math::BigInt->new(q/0x9DBE062CB1F34287 +/)'

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      Try it.

      And read "perldoc bigint"
        Of course! Curse my narrow-minded field of view.

        -QM
        --
        Quantum Mechanics: The dreams stuff is made of

Re^2: to convert 16 dig hex to dec
by Anonymous Monk on Sep 01, 2005 at 10:39 UTC
    I am getting an overflow error Integer overflow in hexadecimal number at hextodec.pl line 8. This is the output 1.13665292985635e+019 I need the output as not in exponential notation but string and I have tried
    $dec = hex $hex; printf "%s", $dec;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://488338]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-24 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found