Martin v. Löwis mar...@v.loewis.de added the comment:
Ok, I'm closing this as won't fix. Mark is our authority on these matters, and
having two spellings for this fairly uncommon operation seems enough.
--
resolution: - wont fix
status: open - closed
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
A hint that the idea would be useful is that there is an FPU instruction,
FSCALE, devoted to this. However, a hint that this isn't needed is that
Fortran and MATLAB don't have it.
--
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11967
___
___
Python-bugs-list mailing list
Changes by Daniel Urban urban.dani...@gmail.com:
--
nosy: +durban
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11967
___
___
Python-bugs-list
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11967
___
___
Python-bugs-list
Martin v. Löwis mar...@v.loewis.de added the comment:
The only way ... That's not true. y=x*(1n) is also an exact multiplication
with a power of two, and it's also fairly fast. Likewise for y=x/(1n).
--
nosy: +loewis
___
Python tracker
Mark Dickinson dicki...@gmail.com added the comment:
Would you want x 2 to be equivalent to x / 4.0 or x // 4.0?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11967
___
Mark Dickinson dicki...@gmail.com added the comment:
The only way to do that now is t=frexp(x) and y=ldexp(t[0],t[1]+2).
What's wrong with the more direct ldexp(x, 2)?
N.B. There *are* edge cases where Martin's suggested alternative won't work.
E.g., to compute 1e-300 * 2**1500:
New submission from David Albert Torpey dt...@users.sourceforge.net:
I would like to left and right shift floats as a fast way to multiply or divide
by a power of 2 without rounding error. The only way to do that now is
t=frexp(x) and y=ldexp(t[0],t[1]+2). But would be better to type y=x2.
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11967
___
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
components: +Interpreter Core
nosy: +rhettinger
type: - feature request
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11967
___
11 matches
Mail list logo