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 serhiy.storchaka
Recipients mark.dickinson, martin.panter, ned.deily, rhettinger, serhiy.storchaka, steven.daprano, tim.peters, vstinner
Date 2016-08-28.16:27:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472401673.1.0.416658723796.issue27761@psf.upfronthosting.co.za>
In-reply-to
Content
Wouldn't following implementation be faster?

    import decimal
    c = decimal.DefaultContext.copy()
    c.prec = 25
    def rootn(x, n,
              D=decimal.Decimal,
              sub=c.subtract,
              mul=c.multiply,
              log=c.ln):
        g = x ** (1.0/n)
        g += float(sub(log(D(x)), mul(log(D(g)), D(n)))) * g / n
        return g
    del decimal, c
History
Date User Action Args
2016-08-28 16:27:53serhiy.storchakasetrecipients: + serhiy.storchaka, tim.peters, rhettinger, mark.dickinson, vstinner, ned.deily, steven.daprano, martin.panter
2016-08-28 16:27:53serhiy.storchakasetmessageid: <1472401673.1.0.416658723796.issue27761@psf.upfronthosting.co.za>
2016-08-28 16:27:53serhiy.storchakalinkissue27761 messages
2016-08-28 16:27:53serhiy.storchakacreate