[Bengt Richter]
...
> But I don't know how to build QNaNs:
You can subtract infinity from infinity. While all Python behavior in
the presence of NaNs, infinities, and signed zeroes is a
platform-dependent accident, it you're on a box that has such things,
and figure out some (accidental!) way to
On Sat, 15 Jan 2005 11:00:36 -0800, Scott David Daniels <[EMAIL PROTECTED]>
wrote:
>G.Franzkowiak wrote:
>> Scott David Daniels schrieb:
>>
>>> franzkowiak wrote:
>>>
I've read some bytes from a file and just now I can't interpret 4
bytes in this dates like a real value. An extract f
G.Franzkowiak wrote:
Scott David Daniels schrieb:
If you really want to do this kind of byte fiddling:
http://members.dsl-only.net/~daniels/block.html
Then:
from block import Block, View
b = Block(4) # enough space for one float (more is fine)
iv = View('i', b) # getting to it as an
Scott David Daniels schrieb:
G.Franzkowiak wrote:
Scott David Daniels schrieb:
franzkowiak wrote:
I've read some bytes from a file and just now I can't interpret 4
bytes in this dates like a real value. An extract from my program:
def l32(c):
return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16
"Scott David Daniels" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> franzkowiak wrote:
>> I've read some bytes from a file and just now I can't interpret 4 bytes
>> in this dates like a real value. An extract from my program:
>> def l32(c):
>> return ord(c[0]) + (ord(c[1])<<
G.Franzkowiak wrote:
Scott David Daniels schrieb:
franzkowiak wrote:
I've read some bytes from a file and just now I can't interpret 4
bytes in this dates like a real value. An extract from my program:
def l32(c):
return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) +
(ord(c[3])<<24)
...
val
franzkowiak wrote:
I've read some bytes from a file and just now I can't interpret 4 bytes
in this dates like a real value. An extract from my program:
def l32(c):
return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + (ord(c[3])<<24)
...
value = l32(f.read(4)) <--- 3F 8C CC CD should
Scott David Daniels schrieb:
franzkowiak wrote:
I've read some bytes from a file and just now I can't interpret 4
bytes in this dates like a real value. An extract from my program:
def l32(c):
return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) +
(ord(c[3])<<24)
...
value = l32(f.read(4))
On 2005-01-15, Scott David Daniels <[EMAIL PROTECTED]> wrote:
>> I've read some bytes from a file and just now I can't interpret 4 bytes
>> in this dates like a real value.
> OK, here's the skinny (I used blocks & views to get the answer):
>
> import struct
> bytes = ''.join(chr(int(txt, 16)) fo
Hello,
I've read some bytes from a file and just now I can't interpret 4 bytes
in this dates like a real value.
An extract from my program
def l32(c):
return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + (ord(c[3])<<24)
...
value = l32(f.read(4)) <--- 3F 8C CC CD should be 1.11
Anyb
10 matches
Mail list logo