Exponentiation is an operation done using floating point numbers. And there's no point in checking if the number is an integer within range of the user's IV or UV types, and converting it to those from the NV.

I don't think it's quite that simple.
Consider the example of 2** 50 provided by the OP - where the result was given as 1.12589990684262e+15.
That particular result is absolute rubbish. The correct figure is 1125899906842624.0 (which is a different value, yet one that is exactly representable inside that perl's NV) :
C:\>perl -le "print 'wtf' if 2 ** 50 == 1.12589990684262e+15;" C:\>perl -le "print 'ok' if 2 ** 50 == 1125899906842624.0;" ok
Why are we so ready to settle for a half-arsed floating point approximation when an exact floating point (or integer) representation is available ?

Also consider that, on a perl whose ivsize is 8 && whose nvsize is 8, you will be told that 3 ** 40 (which equates to less than ~0) is 1.21576654590569e+19.
This is a completely different value to the exact 12157665459056928801, which would be presented if perl DWIMmed by performing integer exponentiation.
And perl prides itself on DWIMming .... ??

Cheers,
Rob

In reply to Re^2: Non-integer print output??? by syphilis
in thread Non-integer print output??? by jwkrahn

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.