The point I was getting at is that 2**1024000, is already logarithmic. Ie. 1024000 is log2 of your number.

Thus, to convert it to log10(), you only need divide it by log2( 10 ).

Then all you need is:

sub log2{ log( $_[0] ) / log( 2 ) } sub log2ToLog10{ $_[0] / log2( 10 ) } print log2ToLog10( 1024000 );; 308254.715559917

And once you have that, displaying it in human readable form becomes:

my $log10 = log2ToLog10( 1024000 ); printf "%.16fe%d\n", 10**( $log10 - int( $log10 )), int( $log10 );; 5.1946933632179482e308254

Which is pretty accurate according to wolfram/alpha:

5.19469336319992513461071316398707637029610983547139039022052215500033 +0748128713140857944929474604946407890576242141198731139214 2324060603669100591443085161671423608538064065009247433495758206421181 +6041163544936451093418528960464769157767991031321856057398 2666947442696473760475992972158927479218009273759516049811496993843563 +6416559392963943454835743787169456588299548100913424497325 0905049420519380402064586712958594039933889035337394627220130813347089 +718415056564330782186171899023705...


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

In reply to Re^2: Efficiently working with huge exponents by BrowserUk
in thread Efficiently working with huge exponents by wanna_code_perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.