Re: How can I do bit operation on python float value

2009-03-23 Thread Miles
On Mon, Mar 23, 2009 at 2:44 AM, valpa wrote: > I have a python float 1.2345678. I know that it is stored as a double > in C type. And I know it actually is 1010101010101 -like format. Then > I want to do some bit operation on it. How? > > Sure, I want a float output when I finish the operation. J

Re: How can I do bit operation on python float value

2009-03-23 Thread John Machin
On Mar 23, 7:44 pm, valpa wrote: > On 3月23日, 上午3时18分, John Machin wrote: > > > > > On Mar 23, 5:44 pm, valpa wrote: > > > > I have a python float 1.2345678. I know that it is stored as a double > > > in C type. And I know it actually is 1010101010101 -like format. Then > > > I want to do some bi

Re: How can I do bit operation on python float value

2009-03-23 Thread Mark Dickinson
On Mar 23, 8:44 am, valpa wrote: > Yes, I want to do a & operation. Right, but what & operation, and why? Are you trying to do something that's mathematically meaningful? If so, there may be a better (more portable/faster/clearer) way than bit-twiddling. Mark -- http://mail.python.org/mailman/l

Re: How can I do bit operation on python float value

2009-03-23 Thread valpa
On 3月23日, 上午3时18分, John Machin wrote: > On Mar 23, 5:44 pm, valpa wrote: > > > I have a python float 1.2345678. I know that it is stored as a double > > in C type. And I know it actually is 1010101010101 -like format. Then > > I want to do some bit operation on it. How? > > > Sure, I want a float

Re: How can I do bit operation on python float value

2009-03-23 Thread John Machin
On Mar 23, 5:44 pm, valpa wrote: > I have a python float 1.2345678. I know that it is stored as a double > in C type. And I know it actually is 1010101010101 -like format. Then > I want to do some bit operation on it. How? > > Sure, I want a float output when I finish the operation. import struct

How can I do bit operation on python float value

2009-03-22 Thread valpa
I have a python float 1.2345678. I know that it is stored as a double in C type. And I know it actually is 1010101010101 -like format. Then I want to do some bit operation on it. How? Sure, I want a float output when I finish the operation. -- http://mail.python.org/mailman/listinfo/python-list