Hello ikegami,

Unfortunately, this thread became an accuracy problem/solution discussion.

My original intent was to discuss the Perl beginner's question of

Any experienced programmer, engineer, scientist, etc. understands the problems associated with base n arithmetic. The problem for the new user of any programming language ( Perl preferred ) is '...why does Perl give me 1.999999999999999, when my simple calculator gives me the *correct* answer of 2." They really don't care that it's technically correct, because they want the calculator answer.

I contributed to this re-direction by showing that I could get the DFP to work on a Linux box with the software shown in the wiki article. I think the writer of the article wanted to show that the integer part of the result was inaccurate (most articles on binary floating point imply the inaccuracy is only after the decimal point). So then the accuracy became the new issue!


This topic is more about the future of Perl, then about the accuracy of Perl. Just like the calculator designer(s) realized that rounding was an important element if they wanted to sell calculators, I think Perl needs to do a *better* job meeting the expectations of new users.

Let me be the example:

I was a system programmer for 15 years and then later an application programmer for many more years before ever using Perl. My stumbling block in the beginning was 'use strict;'. Today all my scripts have that statement. But in the beginning, I would get cryptic warnings, and when I commented out 'use strict;', the script ran and gave the correct answer. But I had to get a lot more experience with Perl before I understood the warning messages. Now I fix the warning and have a better script!


My original intent was to discuss Decimal Floating Point(DFP) as a way to give calculator like answers for most beginners. When more experienced they could use the speed of binary floating point, but would need to do the rounding themselves.

I hope I clarified my intended topic.

Regards...Ed

"Well done is better than well said." - Benjamin Franklin


In reply to Re^4: Decimal Floating Point (DFP) and does Perl needs DFP? by flexvault
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.