Author tim.peters
Recipients David MacIver, mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
Date 2020-07-28.23:54:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595980481.61.0.414985389667.issue41421@roundup.psfhosted.org>
In-reply-to
Content
BTW, if we have to "do something", how about changing

return 1.0 / u ** (1.0/alpha)

to the mathematically equivalent

return (1.0 / u) ** (1.0/alpha)

? Not sure about Linux-y boxes, but on Windows that would raise OverflowError instead of ZeroDivisionError. Which makes more sense, because the Pareto variable we're _trying_ to produce is too large to represent.  If it returns math.inf on some box instead, same thing.

Or, also faster, and suffering fewer rounding errors,

return  u ** (-1.0 / alpha)
History
Date User Action Args
2020-07-28 23:54:41tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, David MacIver
2020-07-28 23:54:41tim.peterssetmessageid: <1595980481.61.0.414985389667.issue41421@roundup.psfhosted.org>
2020-07-28 23:54:41tim.peterslinkissue41421 messages
2020-07-28 23:54:41tim.peterscreate