Message139148
Taken from http://www.slac.stanford.edu/comp/unix/package/rtems/doc/html/libm/libm.info.copysign.html i'd suggest to extend
Return a float with the magnitude of x
to
Return a float with the magnitude (absolute value) of x
It could probably help people less math-savvy in understand what's going to happen :)
Maybe also (only in rest doc) might be nice to describe what happens in case the arguments are NaN, f.e.:
>>> import math
>>> x = float('nan')
>>> math.copysign(1., x)
1.0
>>> math.copysign(-1., x)
1.0
>>> math.copysign(x, -1)
nan
>>> math.copysign(x, x)
nan
umedoblock: would you like to expand the patch with these notes (unless someone objects :)). |
|
Date |
User |
Action |
Args |
2011-06-26 07:49:27 | sandro.tosi | set | recipients:
+ sandro.tosi, terry.reedy, mark.dickinson, r.david.murray, docs@python, umedoblock |
2011-06-26 07:49:27 | sandro.tosi | set | messageid: <1309074567.02.0.116391635937.issue12211@psf.upfronthosting.co.za> |
2011-06-26 07:49:26 | sandro.tosi | link | issue12211 messages |
2011-06-26 07:49:26 | sandro.tosi | create | |
|