Am 30.07.2012 02:44, schrieb Steven D'Aprano:
I wish to extract the bit fields from a Python float, call it x. First I
cast the float to 8-bytes:
s = struct.pack('=d', x)
i = struct.unpack('=q', s)[0]
Then I extract the bit fields from the int, e.g. to grab the sign bit:
(i
On Monday, July 30, 2012 1:44:04 AM UTC+1, Steven D'Aprano wrote:
1) Are there any known implementations or platforms where Python floats
are not C doubles? If so, what are they?
Well, IronPython is presumably using .NET Doubles, while Jython will be using
Java Doubles---in either case,
On 2012-07-30, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
1) Are there any known implementations or platforms where Python floats
are not C doubles? If so, what are they?
And the question you didn't ask: are there any platforms where a C
double isn't IEEE-754?
The last ones
In article jv64v5$g2n$2...@reader1.panix.com,
Grant Edwards invalid@invalid.invalid wrote:
The last ones I worked on that where the FP format wasn't IEEE were
the DEC VAX
According to http://en.wikipedia.org/wiki/Vax#History, the last VAX was
produced 7 years ago. I'm sure there's still
On 30/07/2012 15:16, Grant Edwards wrote:
On 2012-07-30, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
1) Are there any known implementations or platforms where Python floats
are not C doubles? If so, what are they?
And the question you didn't ask: are there any platforms where
On 2012-07-30, Mark Lawrence breamore...@yahoo.co.uk wrote:
On 30/07/2012 15:16, Grant Edwards wrote:
On 2012-07-30, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
1) Are there any known implementations or platforms where Python floats
are not C doubles? If so, what are they?
On Monday, July 30, 2012 3:16:05 PM UTC+1, Grant Edwards wrote:
The last ones I worked on that where the FP format wasn't IEEE were
the DEC VAX and TI's line if 32-bit floating-point DSPs. I don't
think Python runs on the latter, but it might on the former.
For current hardware, there's
On Mon, Jul 30, 2012 at 12:44 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
I wish to extract the bit fields from a Python float, call it x. First I
cast the float to 8-bytes:
s = struct.pack('=d', x)
i = struct.unpack('=q', s)[0]
Then I extract the bit fields from the
In article jv6ab7$jne$1...@reader1.panix.com,
Grant Edwards invalid@invalid.invalid wrote:
I imagine that VAXes running Unix went extinct in the wild long before
VAXes running VMS.
Of course they did. VMS is all about vendor lock-in. People who
continue to run VAXen don't do so because
I wish to extract the bit fields from a Python float, call it x. First I
cast the float to 8-bytes:
s = struct.pack('=d', x)
i = struct.unpack('=q', s)[0]
Then I extract the bit fields from the int, e.g. to grab the sign bit:
(i 0x8000) 63
Questions:
1) Are there any known
On 2012-07-30 at 00:44:04 +,
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
I wish to extract the bit fields from a Python float, call it x. First I
cast the float to 8-bytes:
s = struct.pack('=d', x)
i = struct.unpack('=q', s)[0]
Then I extract the bit fields from the
On 7/29/2012 8:44 PM, Steven D'Aprano wrote:
I wish to extract the bit fields from a Python float, call it x. First I
cast the float to 8-bytes:
s = struct.pack('=d', x)
i = struct.unpack('=q', s)[0]
Then I extract the bit fields from the int, e.g. to grab the sign bit:
(i
12 matches
Mail list logo