Kahan summation: Difference between revisions

Content added Content deleted
(Found incorrectness.)
m (→‎{{header|Perl 6}}: Hmm. not really sure what inaccuracies are in the example...)
Line 1,041: Line 1,041:
{{incomplete|Perl 6|All examples should have constants chosen to clearly show the benefit of Kahan summing!}}|
{{incomplete|Perl 6|All examples should have constants chosen to clearly show the benefit of Kahan summing!}}|
{{trans|Python}}
{{trans|Python}}
Perl 6 does not offer a fixed precision decimal. It ''does'' have IEEE 754 floating point numbers so let's try implementing the arbitrary precision option as shown in Python. Need to explicitly specify scientific notation numbers to force floating point Nums.
Perl 6 does not offer a fixed precision decimal. It ''does'' have IEEE 754 floating point numbers so let's try implementing the floating point option as shown in Python. Need to explicitly specify scientific notation numbers to force floating point Nums.


<lang perl6>constant ε = (1e0, */2e0 … *+1e0==1e0)[*-1];
<lang perl6>constant ε = (1e0, */2e0 … *+1e0==1e0)[*-1];