Author mark.dickinson
Recipients mark.dickinson, ned.deily, nirinA, rhettinger, steven.daprano, stutzbach, terry.reedy, tim.peters
Date 2010-01-02.14:58:56
SpamBayes Score 1.69879e-06
Marked as misclassified No
Message-id <1262444339.73.0.832266824422.issue3366@psf.upfronthosting.co.za>
In-reply-to
Content
> In Python, exp2(x) can be spelled 2.0**x.  What would exp2(x) gain us?

Not much, I suspect.  :)

I'd expect (but am mostly guessing) exp2(x) to have better accuracy than 
pow(2.0, x) for some math libraries;  I'd further guess that it's somewhat 
more likely to give exact results for (small) integral x.

Similarly for log2:  log2(n) should be a touch more accurate than 
log(n)/log(2), and the time you're most likely to notice the difference is 
when n is an exact power of 2.

But we've already got the 'bit_length' method for integers, which fills 
some of the potential uses for log2.  So unless there's a feeling that 
these functions are needed, I'd rather leave them out.
History
Date User Action Args
2010-01-02 14:58:59mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, terry.reedy, ned.deily, stutzbach, nirinA, steven.daprano
2010-01-02 14:58:59mark.dickinsonsetmessageid: <1262444339.73.0.832266824422.issue3366@psf.upfronthosting.co.za>
2010-01-02 14:58:57mark.dickinsonlinkissue3366 messages
2010-01-02 14:58:56mark.dickinsoncreate