Problems? Is your data what you think it is? | |
PerlMonks |
bigint - float?by jhanna (Scribe) |
on Nov 23, 2001 at 20:09 UTC ( [id://127130]=perlquestion: print w/replies, xml ) | Need Help?? |
jhanna has asked for the wisdom of the Perl Monks concerning the following question:
This ought to be really easy, but i haven't found it in the docs. I need the log of a Math::BigInt number. Precision isn't important -- honestly all I really want is the number of bits requred for the bigint. I figured I could do: $bits=int(log($bigint)/log(2))+1; But, alas, Math::BigInt doesn't have log overloaded and I can't figure how to convert a bigint back to a float. :-(
Back to
Seekers of Perl Wisdom
|
|