[issue11967] Left shift and Right shift for floats

2011-05-02 Thread Martin v . Löwis
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

[issue11967] Left shift and Right shift for floats

2011-05-02 Thread Raymond Hettinger
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. --

[issue11967] Left shift and Right shift for floats

2011-05-02 Thread Jesús Cea Avión
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

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Daniel Urban
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11967 ___ ___ Python-bugs-list

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Eric V. Smith
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

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Martin v . Löwis
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

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Mark Dickinson
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 ___

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Mark Dickinson
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:

[issue11967] Left shift and Right shift for floats

2011-04-30 Thread David Albert Torpey
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.

[issue11967] Left shift and Right shift for floats

2011-04-30 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11967 ___ ___

[issue11967] Left shift and Right shift for floats

2011-04-30 Thread Raymond Hettinger
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 ___