[issue11967] Left shift and Right shift for floats

2011-05-02 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue11967] Left shift and Right shift for floats

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

[issue11967] Left shift and Right shift for floats

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

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Mark Dickinson
Mark Dickinson 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: >>> ldexp(1e-300, 1500) 3.5

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Mark Dickinson
Mark Dickinson added the comment: Would you want x >> 2 to be equivalent to x / 4.0 or x // 4.0? -- ___ Python tracker ___ ___ Python

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Martin v . Löwis
Martin v. Löwis added the comment: "The only way ..." That's not true. y=x*(1< ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bug

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue11967] Left shift and Right shift for floats

2011-04-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- components: +Interpreter Core nosy: +rhettinger type: -> feature request ___ Python tracker ___ ___

[issue11967] Left shift and Right shift for floats

2011-04-30 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue11967] Left shift and Right shift for floats

2011-04-30 Thread David Albert Torpey
New submission from David Albert Torpey : 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=x<<2. Thank you. -- me