Title: Move trunc() to math module
Type: Stage:
Components: Extension Modules Versions: Python 3.0, Python 2.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: jyasskin, rhettinger
Priority: high Keywords:

Created on 2008-01-29 18:26 by rhettinger, last changed 2008-02-02 06:00 by jyasskin. This issue is now closed.

Messages (6)
msg61823 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-01-29 18:26

Also, the docstring doesn't seem correct or clear.
msg61949 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2008-02-01 06:26
Moved in r60486. I tried to improve the docstring too.
msg61950 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-02-01 06:36
It would be nice in the docstring the definition of "truncate" wasn't 
assumed.  It would be more specific to say that it rounds towards zero 
or that it is ceil(x) for negatives and floor(x) for positives.  
Alternatively, state that it returns the integer portion of a Real.  
The word "truncate" in the docstring is close to being a circular 
definition -- if you don't know what math.trunc() does, being told it 
truncates isn't especially informative.
msg61992 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2008-02-02 05:07
Go ahead and fix the docstring. I don't really understand what was
incorrect about the original "returns the integral closest to x between
0 and x", so I'm not confident that I'll come up with something you'll like.
msg61993 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-02-02 05:30
The latest version in Py2.6 has wording about truncating toward zero.  
This is fine.  Leaving the report closed.
msg61994 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2008-02-02 06:00
*sigh* That's the version I put there. Did you read the patch before
complaining about it?
Date User Action Args
2008-02-02 06:00:24jyasskinsetmessages: + msg61994
2008-02-02 05:30:47rhettingersetmessages: + msg61993
2008-02-02 05:07:36jyasskinsetassignee: jyasskin -> rhettinger
messages: + msg61992
2008-02-01 06:36:38rhettingersetmessages: + msg61950
2008-02-01 06:26:50jyasskinsetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg61949
2008-01-30 09:55:01christian.heimessetpriority: high
2008-01-29 19:21:16jyasskinsetresolution: accepted
2008-01-29 18:26:41rhettingercreate