Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Turning very larger numbers into an array of bits

by syphilis (Chancellor)
on Feb 05, 2017 at 06:44 UTC ( #1181125=note: print w/replies, xml ) Need Help??


in reply to Re: Turning very larger numbers into an array of bits
in thread Turning very larger numbers into an array of bits

If you use Math::GMP, there's gmp_tstbit

Yes, I'd be using the gmp library (accessed either via Math::GMPz or Math::GMP).

Math::BigInt doesn't seem to have an efficient way to fetch a particular bit

Math::BigInt works with base 10 representations of numbers, which makes it less than ideal for determining values of particular bits.

Cheers,
Rob
  • Comment on Re^2: Turning very larger numbers into an array of bits

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2017-11-18 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?