Perl 6 is using the Rat type to represent rational numbers, such as 1/3, 23/7, .564, etc. With such numbers, calculations made with the four basic operators are generally accurate. This is because the Rat type represents rationals with two integers, one for the numerator and one for the denominator.

When using irrational numbers, such as square root of 2, or trigonometric functions, then Perl 6 is forced to use floating-point arithmetic and suffers from the same drawbacks as other programming languages.

So Perl 6 can do simple interest calculations accurately, but for compound interest calculations, it would fall back on floating-point arithmetic (and its flaws) for most common cases (although it is often possible to work around this if needed).

I agree with your point about Perl and speed not being necessarily mutually exclusive. Even though I am dealing with huge volumes of data (so speed is important to me), I have never needed to actually use things such as Inline::C at $work.


In reply to Re^5: Reasons for Using Perl 6 by Laurent_R
in thread Reasons for Using Perl 6 by aartist

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.