Kahan summation: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl}}: Fix link: Perl 6 --> Raku)
m (added another name for the Kahan summation algorithm.)
Line 4: Line 4:
:This task touches on the details of number representation that is often hidden for convenience in many programming languages. You may need to understand the difference between precision in calculations and precision in presenting answers for example; or understand decimal arithmetic as distinct from the usual binary based floating point schemes used in many languages.
:This task touches on the details of number representation that is often hidden for convenience in many programming languages. You may need to understand the difference between precision in calculations and precision in presenting answers for example; or understand decimal arithmetic as distinct from the usual binary based floating point schemes used in many languages.
</small>
</small>



The [[wp:Kahan summation algorithm|Kahan summation algorithm]] is a method of summing a series of numbers represented in a limited precision in a way that minimises the loss of precision in the result.
The [[wp:Kahan summation algorithm|Kahan summation algorithm]] is a method of summing a series of numbers represented in a limited precision in a way that minimises the loss of precision in the result.


(The &nbsp; '''Kahan summation algorithm''' &nbsp; is also known as the &nbsp; '''summation with carry algorithm'''.)



'''The task''' is to follow the previously linked Wikipedia articles algorithm and its [[wp:Kahan_summation_algorithm#Worked_example|worked example]] by:
'''The task''' is to follow the previously linked Wikipedia articles algorithm and its [[wp:Kahan_summation_algorithm#Worked_example|worked example]] by: