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


Groups > comp.lang.python > #106959

Re: sum accuracy

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Jussi Piitulainen <jussi.piitulainen@helsinki.fi>
Newsgroups comp.lang.python
Subject Re: sum accuracy
Date Wed, 13 Apr 2016 19:57:26 +0300
Organization A noiseless patient Spider
Lines 7
Message-ID <lf5a8kx4fbd.fsf@ling.helsinki.fi> (permalink)
References <570E78F9.8050409@chamonix.reportlab.co.uk> <mailman.83.1460566278.15650.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="10163"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+A5vmKhTMleqgcMKl8+nOj/iXkQndqO18="
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:m5/L7tqnE+xhMxn+4aGLEYUmTgw= sha1:51NFIFkbVwyDFx3U/ldn0ZWxP9Y=
Xref csiph.com comp.lang.python:106959

Show key headers only | View raw


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.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

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

csiph-web