Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Bit by a Hex String

by Abigail-II (Bishop)
on Aug 29, 2003 at 15:45 UTC ( [id://287725]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Bit by a Hex String
in thread Bit by a Hex String

$num1=Math::BigInt->new("0x".$source);

Ah, I didn't know you could do that. The Math::BigInt manual page says:

Input Input values to these routines may be either Math::Big- Int objects or strings of the form "/^[+-]?[\d]+\.?[\d]*E?[+-]?[\d]*$/".

Abigail

Replies are listed 'Best First'.
Re: Re: Bit by a Hex String
by abitkin (Monk) on Aug 29, 2003 at 15:52 UTC
    Neither did I

    I only tried it after seeing this in the documentation:

    Examples for converting: my $x = Math::BigInt->new('0b1'.'01' x 123); print "bin: ",$x->as_bin()," hex:",$x->as_hex()," dec: ",$x,"\n";

    ==
    Kwyjibo. A big, dumb, balding North American ape. With no chin.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-24 01:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found