Numerical integration: Difference between revisions
m
→{{header|Perl 6}}: moved commentary to top, fixed language version tag
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: corrected formatting tags) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: moved commentary to top, fixed language version tag) |
||
Line 3,340:
=={{header|Perl 6}}==
The addition of <tt>'''Promise'''</tt>/<tt>'''await'''</tt>
{{works with|rakudo|2018-09}}▼
Note that these integrations are done with rationals rather than floats, so should be fairly precise (though of course with so few iterations they are not terribly accurate (except when they are)). Some of the sums do overflow into <tt>Num</tt> (floating point)--currently Rakudo allows 64-bit denominators--but at least all of the interval arithmetic is exact.▼
<lang perl6>use MONKEY-SEE-NO-EVAL;
Line 3,437 ⟶ 3,440:
composite trapezoidal rule: 18000000
quadratic simpsons rule: 18000000</pre>
▲Note that these integrations are done with rationals rather than floats, so should be fairly precise (though of course with so few iterations they are not terribly accurate (except when they are)). Some of the sums do overflow into <tt>Num</tt> (floating point)--currently Rakudo allows 64-bit denominators--but at least all of the interval arithmetic is exact.
=={{header|Phix}}==
|