[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2010-01-02 Thread Mark Dickinson
Mark Dickinson added the comment: Applied in r77234 (trunk), r77237 (py3k). -- resolution: -> accepted stage: patch review -> committed/rejected status: open -> closed versions: +Python 3.2 -Python 3.1 ___ Python tracker

[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-12-29 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch: - rename _PyLong_AsScaledDouble to _PyLong_Frexp (for the benefit of anyone foolish enough to be using an undocumented private API function) - make the exponent type Py_ssize_t instead of int - do the scaling by PyLong_SHIFT in _PyLong_

[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-12-29 Thread Mark Dickinson
Mark Dickinson added the comment: > Long double (80 bits) exponent is in range [-16382; 16383] and so would > fits in an int, unsigned int, size_t or Py_ssize_t. Sure, but I don't think that's relevant to the point I was attempting to make: PyLong_AsScaledDouble returns the number of bits in

[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-03-29 Thread STINNER Victor
STINNER Victor added the comment: Long double (80 bits) exponent is in range [-16382; 16383] and so would fits in an int, unsigned int, size_t or Py_ssize_t. I don't know if a signed or unsigned number is better. I know only one operation on exponents: a-b in PyLong_AsDouble. -- __

[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-03-28 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> marketdickinson priority: -> normal stage: -> patch review type: -> feature request ___ Python tracker ___

[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-03-28 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for this. I'll take a look. How about making the exponent type size_t or Py_ssize_t, rather than [unsigned] int? It seems to me that that fits better with the usual size in digits. -- ___ Python tracker

[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-03-26 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +marketdickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue5576] Don't use PyLong_SHIFT with _PyLong_AsScaledDouble()

2009-03-26 Thread STINNER Victor
New submission from STINNER Victor : _PyLong_AsScaledDouble() writes the exponent in a int which have to be multiplied by PyLong_SHIFT to give the power of 2. I proposed to multiply the exponent by PyLong_SHIFT in _PyLong_AsScaledDouble() to directly get the power of 2. It avoids complex code