Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Reasons for Using Perl 6

by Laurent_R (Canon)
on Dec 23, 2017 at 20:24 UTC ( [id://1206123]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Reasons for Using Perl 6
in thread Reasons for Using Perl 6

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1206123]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-23 16:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found