Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106958 > unrolled thread

sum accuracy

Started byRobin Becker <robin@reportlab.com>
First post2016-04-13 17:51 +0100
Last post2016-04-13 19:57 +0300
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  sum accuracy Robin Becker <robin@reportlab.com> - 2016-04-13 17:51 +0100
    Re: sum accuracy Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-04-13 19:57 +0300

#106958 — sum accuracy

FromRobin Becker <robin@reportlab.com>
Date2016-04-13 17:51 +0100
Subjectsum accuracy
Message-ID<mailman.83.1460566278.15650.python-list@python.org>
Does anyone know if sum does anything special to try and improve accuracy? My 
simple tests seem to show it is exactly equivalent to a for loop summation.
-- 
Robin Becker

[toc] | [next] | [standalone]


#106959

FromJussi Piitulainen <jussi.piitulainen@helsinki.fi>
Date2016-04-13 19:57 +0300
Message-ID<lf5a8kx4fbd.fsf@ling.helsinki.fi>
In reply to#106958
Robin Becker writes:

> Does anyone know if sum does anything special to try and improve
> accuracy? My simple tests seem to show it is exactly equivalent to a
> for loop summation.

You want math.fsum.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web