[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock umedobl...@gmail.com added the comment: abs() behavior show below. type(abs(-1)) class 'int' type(abs(-1.0)) class 'float' we should fix this problem if write Return abs(x) with the sign of y I'd like to try this problem if need fix. I'm going to attach the patch. --

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: How about something like: Return a float with the magnitude of x but the sign of y.? The behaviour of math.copysign with respect to non-float inputs matches that of almost all the other math module functions: integer arguments are first

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Return a float with the magnitude of x but the sign of y. This appears to describe both current behavior and what I believe was the intention. I would go with a doc patch based on this. umedoblock, go ahead and make one. It occurred to me,

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock umedobl...@gmail.com added the comment: I made the patch. But it cannot pass testCopysign(). math.copysign(1, -0.) returns 1. I hope to return -1. But I don't know how to realize -0. as negative value. Please help me. -- components: +Library (Lib) -Documentation keywords:

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock umedobl...@gmail.com: Removed file: http://bugs.python.org/file22249/math_copysign.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12211 ___

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock umedobl...@gmail.com: Added file: http://bugs.python.org/file22250/math_copysign.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12211 ___

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
Changes by umedoblock umedobl...@gmail.com: Removed file: http://bugs.python.org/file22250/math_copysign.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12211 ___

[issue12211] math.copysign must keep object type.

2011-06-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: umedoblock: David, Mark, and I agree that this should be a doc issue, and so I suggested a DOC patch. So I do not know why you are screwing around with the code, or what you are trying to do with it, or why you are messing around with the

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock umedobl...@gmail.com added the comment: sorry. I fix my bug. but this patch contain new fail... math.copysign(-1., 0.) returns 1. -- Added file: http://bugs.python.org/file22251/math_copysign.patch ___ Python tracker

[issue12211] math.copysign must keep object type.

2011-06-04 Thread umedoblock
umedoblock umedobl...@gmail.com added the comment: I attached DOC patch. I misunderstand ? Sorry... I think that go ahead and make one means I shuold make the source patch. I use just Python3.2. I didn't use Python 2.x, 3.0 and 3.1 in my programming life. Therefore I reported version 3.2. I

[issue12211] math.copysign must keep object type.

2011-06-03 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: As with all the math docs, 'x' refers to the value, not the object with the value. However, Return abs(x) with the sign of y is, to me, clearer and more accurate. Both doc string and doc chapter should get any modification. -- nosy:

[issue12211] math.copysign must keep object type.

2011-05-29 Thread umedoblock
New submission from umedoblock umedobl...@gmail.com: I expected return int if I gave x as integer to copysign. I encounterd two problems. I'd like to fix this problems. but I can't come up with nice idea. therefore I just report for you. one: import math a = [0, 1, 2, 3] i = 1 i_copysign =

[issue12211] math.copysign must keep object type.

2011-05-29 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12211 ___ ___

[issue12211] math.copysign must keep object type.

2011-05-29 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Except when explicitly noted otherwise, all return values are floats. On the other hand, copysign says return x with the sign of y, which certainly sounds like it is preserving x, not creating a new float. So at the least there is a