Closed terryjreedy closed 14 years ago
The last two functions to consider adding are exp2 and log2. Does anyone care about these?
Any time I've ever needed log2(x), log(x)/log(2) was sufficient.
In Python, exp2(x) can be spelled 2.0**x. What would exp2(x) gain us?
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.
Will close this unless there's an outcry of support for exp2 and log2. nirinA, if you're still interested in adding the euler constant, please open another issue.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields: ```python assignee = 'https://github.com/mdickinson' closed_at =
created_at =
labels = ['type-feature', 'library']
title = 'Add gamma function, error functions and other C99 math.h functions to math module'
updated_at =
user = 'https://github.com/terryjreedy'
```
bugs.python.org fields:
```python
activity =
actor = 'mark.dickinson'
assignee = 'mark.dickinson'
closed = True
closed_date =
closer = 'mark.dickinson'
components = ['Library (Lib)']
creation =
creator = 'terry.reedy'
dependencies = []
files = ['10955', '10973', '10974', '10975', '10976', '10977', '10982', '11005', '14844', '14927', '14940', '14943', '15008', '15152', '15488', '15489', '15490', '15491', '15539', '15540', '15574']
hgrepos = []
issue_num = 3366
keywords = ['patch', 'needs review']
message_count = 54.0
messages = ['69698', '70106', '70108', '70120', '70125', '70128', '70131', '70232', '70233', '70241', '70262', '70266', '70267', '70270', '70361', '70412', '77075', '92294', '92844', '92928', '92935', '92936', '92939', '92944', '92948', '93228', '93370', '93373', '94165', '94166', '94168', '94169', '94170', '94171', '94172', '94175', '94224', '96108', '96109', '96110', '96111', '96266', '96267', '96268', '96332', '96333', '96485', '96497', '96599', '96600', '97127', '97131', '97133', '97160']
nosy_count = 8.0
nosy_names = ['tim.peters', 'rhettinger', 'terry.reedy', 'mark.dickinson', 'ned.deily', 'stutzbach', 'nirinA', 'steven.daprano']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'commit review'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue3366'
versions = ['Python 2.7', 'Python 3.2']
```