This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients David MacIver, bar.harel, benjamin.peterson, mark.dickinson, steven.daprano
Date 2015-09-19.19:29:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442690955.44.0.771600760834.issue25177@psf.upfronthosting.co.za>
In-reply-to
Content
That patch doesn't really help, I'm afraid, since it introduces problems at the other end of the floating-point range: for example, `mean([5e-324, 5e-324])` would give `0.0` with that patch (instead of the `5e-324` it currently gives).

So currently, when computing the mean of a sequence of floats (possibly mixed with ints), the code:

1. Computes the sum as a Fraction.
2. Converts that Fraction to a float.
3. Divides the result by the number of elements.

Reversing steps 2 and 3 here would solve the issue, but would require some refactoring.  It's really up to Steven whether he thinks that that refactoring is worth it for these corner cases at the extremes of the floating-point range.  (It's difficult to imagine that such numbers would turn up frequently in practical applications.)
History
Date User Action Args
2015-09-19 19:29:15mark.dickinsonsetrecipients: + mark.dickinson, benjamin.peterson, steven.daprano, David MacIver, bar.harel
2015-09-19 19:29:15mark.dickinsonsetmessageid: <1442690955.44.0.771600760834.issue25177@psf.upfronthosting.co.za>
2015-09-19 19:29:15mark.dickinsonlinkissue25177 messages
2015-09-19 19:29:15mark.dickinsoncreate