Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Extract double in binary file
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bengt Richter  
View profile  
 More options Dec 2 2003, 5:17 pm
Newsgroups: comp.lang.python
From: b...@oz.net (Bengt Richter)
Date: 2 Dec 2003 22:17:42 GMT
Local: Tues, Dec 2 2003 5:17 pm
Subject: Re: Extract double in binary file
On 2 Dec 2003 09:40:50 -0800, pascal.par...@free.fr (Pascal) wrote:

>A very big thanks to you.
>The function run perfectly (after python 2.3! installed for enumerate function)
>If you can, give me more details on the methode or the number's representation.

>Thanks a lot!

According to an old MASM 5.0 programmer's guide, there was a Microsoft Binary format
for encoding real numbers, both short (32 bits) and long (64 bits).

There were 3 parts:

1. Biased 8-bit exponent in the highest byte (last in the little-endian view we've been using)
   It says the bias is 0x81 for short numbers and 0x401 for long, but I'm not sure where that lines up.
   I just got there by experimentation.

2. Sign bit (0 for +, 1 for -) in upper bit of second highest byte.

3. All except the first set bit of the mantissa in the remaining 7 bits of the second highest byte,
   and the rest of the bytes. And since the most signficant bit for non-zero numbers is 1, it
   is not represented. But if if were, it would share the same bit position where the sign is
   (that's why I or-ed it in there to complete the actual mantissa).

MASM also supported a 10-byte format similar to IEEE. I didn't see anything in that section
on NaNs and INFs.

HTH

Regards,
Bengt Richter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.