I don't really know much about MPFR

It's good for reference - if you want to be assured of correctness in assignment, rounding and calculation. I've just now used it to demonstrate to myself that one cannot guarantee that either the "left-to-right" or "right-to-left" exponentiation calculations are going to be as (or more) accurate than performing the requisite number of multiplications.

The example I'll give is the calculation of 5.35 ** 107 - correct figure for which (to 15 decimal digits) is 8.58726126272004e77. Using double precision, the right-to-left method yields 8.58726126271995e77, left-to-right yields 8.58726126271996e77 and cumulatively multiplying 5.35 by itself 106 times yields 8.58726126271998e77 which is closest to the actual value.
(Both perl and mpfr are returning the same results.)

I.e. decimals are normally human made!

But it's those human made numbers that we're normally interested in. When I multiply (on a computer) A by B I'm generally not really interested in finding the product of the base 2 approximations of A and B.
I usually just want to know what A times B is.
And it would surely seem strange to aliens that our human made machines that we use to process our human made decimal numbers in fact don't process *those* numbers.
Doesn't seem strange to us of course - we're all well and truly accustomed to that just being a fact of life ;-)

Cheers,
Rob

In reply to Re^9: Decimal Floating Point (DFP) and does Perl needs DFP? by syphilis
in thread Decimal Floating Point (DFP) and does Perl needs DFP? by flexvault

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.