Message97133
> 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. |
|
Date |
User |
Action |
Args |
2010-01-02 14:58:59 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, rhettinger, terry.reedy, ned.deily, stutzbach, nirinA, steven.daprano |
2010-01-02 14:58:59 | mark.dickinson | set | messageid: <1262444339.73.0.832266824422.issue3366@psf.upfronthosting.co.za> |
2010-01-02 14:58:57 | mark.dickinson | link | issue3366 messages |
2010-01-02 14:58:56 | mark.dickinson | create | |
|