Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

Whatever happened to _fieeetomsbin()?

8 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Jim Marshall

ungelesen,
03.11.1997, 03:00:0003.11.97
an

They removed it sinc eit was an "outdated" function. Below is a post from
someone which may help you (very long)

--
Why are builders afraid to have a 13th floor
but book publishers aren't afraid to have a Chapter 11?
---------------------------------------------------------------------------
---
| Author for Pinnacle Publishing "Visual C++ Developer"
http://www.pinpub.com/ |
| http://lucifer.lotus.com/jim/main.htm
|
---------------------------------------------------------------------------
---


========
Newsgroups: Microsoft.private.mvp.VisualC
Subject: Re: MBF to IEEE
From: (Felix Kasza [MVP])
Date: Sun, 30 Jun 1996 10:10:22 GMT
Here is the message I post when this question crops up:
> Does anybody know a algorithm or function for converting Microsoft Binary
> Format to IEEE format?
This is an all-time favorite, it seems. I am aghast at seeing how
many old-style datafiles seem to be floating around ... Anyway, I got
that question on CIS a year ago. Phil Seth was kind enough not only
to save my description of the MBF format, but also to add a full set
of conversion routines. Below is the text of the thread.
My gratitude goes to Phil Seth for saving my original posts, and for
sharing his conversion routines with us.
---[begin quoted thread]---
==========
mslang/S4_C_C++_Run-Time_Lib #303330, from Philip_D._Seth, 8564 chars,
26-Jan-96
02:27:19
Comment to 302908.
----------
Subject: dmsbintoieee()
Fm: Philip D. Seth 71360,3535
To: Phil Medaglia 73113,1060
Phil,
Here are the messages that Felix sent last October (Thanks Felix!). I
can also send you my current C versions of all 4 routines based on
Felix's if you want.
Philip D. Seth, Marchant Dance Corporation, writing at 17:26 PST 25
Jan 1996
----------------------------------------------------------------------------
-
OK, let's take a look at this. I am making this up from memory as I go
along, so all examples and so on to follow are untested, no
warranties, YMMV.
The MS binary format (MBF) consists of an 8bit binary exponent in the
first byte (unsigned, exponent biased by 80h), followed by a sign bit,
followed by a 55bit or 23bit mantissa (depending on whether we talk
double or single precision). The first digit of the full 56bit
mantissa would always be a binary 1, so they used this bit position
for the sign of the number. The mantissa itself is unsigned (IOW,
stored as sign and absolute value, not in 2's complement).
Here is what 1.5 looks like in 8byte MBF (hex):
81 40 00 00 00 00 00 00
81 says the exponent is 1, so we have to multiply the mantissa by 2^1
== 2. 40h is 01000000 binary; the first bit is the sign (0 ==
positive). Let's remember that and put the implied "1" back in:
11000000 (followed by 6 bytes of 00000000)
That's the mantissa. The binary point is to the left, so what we have
here is 1 half plus 1 fourth plus 0 eighths plus 0 sixteenths ... The
mantissa is therefore 3 fourths, or 0.75 in decimal. Multiplied by the
2^1, that gives 1.5.
Now for the IEEE side of things. We'll only look at 8byte reals (the
familiar "double" type). IEEE format sacrifices precision for extended
range; it uses an 11bit exponent, biased by 1023, and accordingly has
only 52bits of mantissa (53 if we count the implied "1" bit). Also, it
has the mantissa's sign in front, as the most significant bit of the
most significant byte. (Reminds me -- all values I show here start
with the highest byte and end with the lowest byte, contrary to the
memory representation of things.) Another, minor, difference is that
the binary point is not before the implied "1" bit but _after_ it.
That means we'll have to adjust the exponent bias by 1.
The sequence of steps needed to convert an MBF number to a double is
therefore:
- get the sign bit, stick it into the double
- get and unbias the exponent, bias by 1023, right-adjust into 11bit
field in the double
- get and truncate the mantissa (excluding the MBF sign), left-align
into the mantissa field in the double
I have obviously omitted a few things, like error checking. We are
safe from exponent overflow, but if the MBF number is a denormalized
one with all zeroes in the mantissa except for the last three bits,
then after truncation it will be a double with a 0 mantissa but a
non-zero exponent and still an implied "1" bit -- in other words,
denormalized numbers are incorrectly converted by the simple-minded
algorithm above. In fact, I have no idea at all whether denorms are at
all possible in MBF ... I hope not.
typedef union _dbl_t
{
double d;
unsigned short i[4];
unsigned long l[2];
} dbl_t;
double conv_from_mbf( dbl_t mb ) // mb is input MBF number
{
int shifts;
dbl_t ie; // will hold converted value
// I special-case all-zero because the exponent should not
// be biased. Rather, 0 is represented by a pattern of all
// binary zeroes.
if ( mb.l[0] == 0L && mb.l[1] == 0L )
return 0.0;
// get exponent value
ie.i[3] = (unsigned short) mb.i[3] >> 8;
// ie.i[3] now has an exponent still biased by 0x80
// adjust by -1 to compensate for 0.111... vs. 1.111...
ie.i[3] += 1023 - 0x80 - 1; // convert to 1023 bias
// left-adjust, leaving one bit for the sign
ie.i[3] <<= 4; // 00000xxxxxxxxxxxx ==> 0xxxxxxxxxxx0000
// next line ORs the sign bit into the word containing the exp.
ie.i[3] |= ( mb.i[3] & 0x0080 )? 0x8000: 0x0000;
// next line gets four bits of mantissa which will fit into the
// exponent word
ie.i[3] |= (unsigned short) ( mb.i[3] >> 3 ) & 0x000f;
// now we have 6-3/8 bytes mantissa left to shoehorn into 6 bytes.
// we do that by right-shifting the entire mbf by three bits and
// masking off what we don't need. this would be easier if C
// had a roll-through-carry operator.
for ( shifts = 0; shifts < 3; shifts ++ )
{
mb.l[0] >>= 1; // shift low doubleword
// the next line examines the lowest bit of the high dword
// which must become the highest bit of the low dword. if
// it is set, the low dword gets ORed with a 1 in the highest
// bit position. I wish we'd be doing this in the assembly
// section ...
mb.l[0] |= ( mb.l[1] & 0x00000001L )? 0x80000000L: 0L;
// shift the high dword now. the lowest bit gets lost which is
// why we checked it above.
mb.l[1] >>= 1;
}
// now, ignore the highest 16 bits (which in the IEEE number we
// already filled) and transfer the remaining 48 bits
ie.i[2] = mb.i[2];
ie.i[1] = mb.i[1];
ie.i[0] = mb.i[0];
// THAT'S IT!
return ie.d;
}
The code above is extremely inefficient. Things like this really are
candidates for assembly, and on a 32bit processor, we might have
gained a bit of efficiency (even in C) by processing the MBF as two
longs and sequencing the masks & shifts such that some intermediate
steps can be saved. It's just that I thought this was good enough for
an example.
Cheers,
Felix.
P.S.: Somebody please save this. That's the Nth time I did that.

here we are again with our next installment of "Floats From Hell".
#include <stdio.h>
#define lenof(x) ( sizeof( (x) ) / sizeof( (x)[0] ) )
// converts 8byte MBF number pointed to by pMbf to IEEE double
double mbf2ieee( const char *const pMbf )
{
double ieee; // holds result when done
if ( *( (const __int64 *const) pMbf ) == 0 )
return 0.0;
__asm
{
mov ebx, pMbf
mov eax, [ebx] ; low word of mbf
mov edx, [ebx+4] ; high word of mbf
; first shift all right by 3 to get mantissa's low word
shr edx, 1
rcr eax, 1
shr edx, 1
rcr eax, 1
shr edx, 1
rcr eax, 1 ; eax now has 32 LSBs
mov dword ptr [ieee], eax ; eax is now free to be reused
mov al, [ebx+7] ; get exponent byte
add ax, 894 ; 1023 - 128 - 1
shl ax, 4 ; left-adjust
test byte ptr [ebx+6], 80h ; sign bit?
jz no_sign
or ah, 80h ; else set
no_sign:
shl eax, 16 ; left-adjust
mov edx, [ebx+4] ; get high word again
shr edx, 3 ; lowest three bits
; already in loword
and edx, 000fffffh ; mask off old sign and exp
or eax, edx ; combine new sign/exp with
; leftmost part of mantissa
mov dword ptr [ieee+4], eax ; save
}
return ieee;
}
int main( void )
{
int i;
static struct _testdata
{
char mbf[8];
double expected;
} testdata[] =
{
{ { 0, 0, 0, 0, 0, 0, 0x70, 0x81 }, 15.0/8.0 },
{ { 0, 0, 0, 0, 0, 0, 0x60, 0x81 }, 7.0/4.0 },
{ { 0, 0, 0, 0, 0, 0, 0x50, 0x81 }, 13.0/8.0 },
{ { 0, 0, 0, 0, 0, 0, 0x40, 0x81 }, 6.0/4.0 },
{ { 0, 0, 0, 0, 0, 0, 0x60, 0x80 }, 7.0/8.0 },
{ { 0, 0, 0, 0, 0, 0, 0x40, 0x80 }, 3.0/4.0 },
{ { 0, 0, 0, 0, 0, 0, 0x40, 0x7f }, 3.0/8.0 },
{ { 0, 0, 0, 0, 0, 0, 0xf0, 0x81 }, -15.0/8.0 },
{ { 0, 0, 0, 0, 0, 0, 0xe0, 0x81 }, -7.0/4.0 },
{ { 0, 0, 0, 0, 0, 0, 0xd0, 0x81 }, -13.0/8.0 },
{ { 0, 0, 0, 0, 0, 0, 0xc0, 0x81 }, -6.0/4.0 },
{ { 0, 0, 0, 0, 0, 0, 0xe0, 0x80 }, -7.0/8.0 },
{ { 0, 0, 0, 0, 0, 0, 0xc0, 0x80 }, -3.0/4.0 },
{ { 0, 0, 0, 0, 0, 0, 0xc0, 0x7f }, -3.0/8.0 },
{ { 0, 0, 0, 0, 0, 0, 0x00, 0x00 }, 0.0 }
};
for ( i = 0; i < lenof( testdata ); i ++ )
printf( "[%d]:\t%7.3lf %7.3lf\n", i,
testdata[i].expected, mbf2ieee( testdata[i].mbf ) );
return 0;
}
Enjoy!
Cheers,
Felix.
==========
mslang/S4_C_C++_Run-Time_Lib #303344, from Felix_A._Kasza, 1174 chars,
26-Jan-96
04:04:28
Comment to 303330.
----------
Subject: dmsbintoieee()
Fm: Felix A. Kasza 100435,3203
To: Philip D. Seth 71360,3535
Philip,
my heartfelt thanks and eternal gratitude for saving this. I have now
marked this message "keep" in my OLR. (You see, I thought then it
would be a one-off, never to be needed again. I am absolutely stunned
to see how often those MBFs from hell turn up.)
If the terms under which you wrote your routines permit it, would you
share your code with us? It does look as if there was interest in it,
and I would save them, too -- for future reference.
Cheers & thanks,
Felix.
P.S.: Anybody notice the *horrible* bug in the __asm code?
mov dword ptr [ieee], eax ; eax is now free to be reused
mov al, [ebx+7] ; get exponent byte
add ax, 894 ; 1023 - 128 - 1
shl ax, 4 ; left-adjust
Well, at the point where we mov al, [ebx+7], who says that AH is
clear? We definitely should sub ah, ah before we add a 16bit number to
AX. Sorry for the inconvenience this has probably caused; believe me
when I say I hang my head in shame. I will, as soon as I can move
again, flog myself.
==========
mslang/S4_C_C++_Run-Time_Lib #303861, from Philip_D._Seth, 3463 chars,
30-Jan-96
19:21:23
Comment to 303497.
----------
Subject: dmsbintoieee()
Fm: Philip D. Seth 71360,3535
To: Phil Medaglia 73113,1060
Phil,
No problem! In these routines I was more concerned about understanding
what is happening (especially in a few months!) than efficiency. I
haven't finished testing these routines, so be careful! Here they are:
Regards,
Phil
Philip D. Seth, Marchant Dance Corporation, writing at 22:00 PST 29
Jan 1996
----------------------------------------------------------------------------
typedef union _mbf_dbl_t
{
double d;
unsigned short i[4];
unsigned long l[2];
} Mbfd_t;
int DMsbinToIeee( double *source, double *dest )
// ---[comments reformatted for line breaks. - felixk]---
// Description:
// This function was written by Felix A. Kasza [MVP on MSLANG
// Compuserve forum] as a sample of what is required to convert
// a Microsoft binary format double precision number to an ieee
// format double.
// Parameters:
// source - pointer to MBF format double to convert
// dest - pointer to buffer for ieee result
// Return:
// 0 - conversion was successful
// 1 - overflow
// Shared Data:
// none
// Use of Other Routines:
// none
// Assumptions/Cautions:
// The routine assumes that the MBF double is normalized.
//
// Some precision may be lost because the ieee format uses fewer
// bits for the mantissa.
{
int shifts;
Mbfd_t ie; // will hold converted value
Mbfd_t mb; // temporary storage for MBF value
// Copy the number to be converted to a union for easier handling.
mb.d = *source;
// I special-case all-zero because the exponent should not
// be biased. Rather, 0 is represented by a pattern of all
// binary zeroes.
if ( mb.l[0] == 0L && mb.l[1] == 0L ) {
*dest = 0.0;
return 0;
}
// get exponent value
ie.i[3] = (unsigned short) mb.i[3] >> 8;
// ie.i[3] now has an exponent still biased by 0x80
// adjust by -1 to compensate for 0.111... vs. 1.111...
ie.i[3] += 894; // convert to 1023 bias (+1023 - 128 - 1)
// left-adjust, leaving one bit for the sign
ie.i[3] <<= 4; // 00000xxxxxxxxxxxx ==> 0xxxxxxxxxxx0000
// next line ORs the sign bit into the word containing the exp.
ie.i[3] |= ( mb.i[3] & 0x0080 )? 0x8000: 0x0000;
// next line gets four bits of mantissa which will fit into the
// exponent word
ie.i[3] |= (unsigned short) ( mb.i[3] >> 3 ) & 0x000f;
// now we have 6-3/8 bytes mantissa left to shoehorn into 6 bytes.
// we do that by right-shifting the entire mbf by three bits and
// masking off what we don't need. this would be easier if C
// had a roll-through-carry operator.
for ( shifts = 0; shifts < 3; shifts ++ )
{
mb.l[0] >>= 1; // shift low doubleword
// the next line examines the lowest bit of the high dword
// which must become the highest bit of the low dword. if
// it is set, the low dword gets ORed with a 1 in the highest
// bit position. I wish we'd be doing this in the assembly
// section ...
mb.l[0] |= ( mb.l[1] & 0x00000001L )? 0x80000000L: 0L;
// shift the high dword now. the lowest bit gets lost which is
// why we checked it above.
mb.l[1] >>= 1;
}
// now, ignore the highest 16 bits (which in the IEEE number we
// already filled) and transfer the remaining 48 bits
ie.i[2] = mb.i[2];
ie.i[1] = mb.i[1];
ie.i[0] = mb.i[0];
// THAT'S IT!
*dest = ie.d;
return 0;
} // End DMsbinToIeee()
[More]
There is 1 Reply.
==========
mslang/S4_C_C++_Run-Time_Lib #303862, from Philip_D._Seth, 2262 chars,
30-Jan-96
19:21:31
Comment to 303861.
----------
Subject: dmsbintoieee()
Fm: Philip D. Seth 71360,3535
To: Philip D. Seth 71360,3535
[Continued]
----------------------------------------------------------------------------
typedef union _mbf_flt_t
{
float f;
unsigned short i[2];
unsigned long l;
} Mbff_t;
int FMsbinToIeee( float *source, float *dest )
// ---[comments reformatted for line breaks. - felixk]---
// Description:
// This function is based on a function written by Felix A. Kasza
// [MVP on MSLANG Compuserve forum] as a sample of what is required
// to convert a Microsoft binary format double precision number to
// an ieee format double. Modified to handle a float by Philip D.
// Seth.
// Parameters:
// source - pointer to MBF format float to convert
// dest - pointer to buffer for ieee result
// Return:
// 0 - conversion was successful
// 1 - overflow
// Shared Data:
// none
// Use of Other Routines:
// none
// Assumptions/Cautions:
// The routine assumes that the MBF float is normalized.
//
// Some precision may be lost because the ieee format uses fewer
// bits for the mantissa.
{
Mbff_t ie; // will hold converted value
Mbff_t mb; // temporary storage for MBF value
// Copy the number to be converted to a union for easier handling.
mb.f = *source;
// I special-case all-zero because the exponent should not
// be biased. Rather, 0 is represented by a pattern of all
// binary zeroes.
if ( mb.l == 0L ) {
*dest = 0.0F;
return 0;
}
// get exponent value
ie.i[1] = (unsigned short) mb.i[1] >> 8;
// ie.i[1] now has an exponent still biased by 0x80
// adjust by -1 to compensate for 0.111... vs. 1.111...
ie.i[1] -= 2; // convert to 127 bias (-128 + 127 - 1)
// left-adjust, leaving one bit for the sign
ie.i[1] <<= 7; // 00000000xxxxxxxx ==> 0xxxxxxxx0000000
// next line ORs the sign bit into the word containing the exp.
ie.i[1] |= ( mb.i[1] & 0x0080 )? 0x8000: 0x0000;
// next line gets seven bits of mantissa which will fit into the
// exponent word
ie.i[1] |= (unsigned short) ( mb.i[1] & 0x007f );
// now we have 2 bytes of mantissa left to copy into 2 bytes.
ie.i[0] = mb.i[0];
// THAT'S IT!
*dest = ie.f;
return 0;
} // End FMsbinToIeee()
[More]
There is 1 Reply.
==========
mslang/S4_C_C++_Run-Time_Lib #303863, from Philip_D._Seth, 3364 chars,
30-Jan-96
19:21:42
Comment to 303862.
----------
Subject: dmsbintoieee()
Fm: Philip D. Seth 71360,3535
To: Philip D. Seth 71360,3535
[Continued]
----------------------------------------------------------------------------
#include <float.h>
typedef union _mbf_dbl_t
{
double d;
unsigned short i[4];
unsigned long l[2];
} Mbfd_t;
int DIeeeToMsbin( double *source, double *dest )
// Description:
// This function is based on a function written by Felix A. Kasza
// [MVP on MSLANG Compuserve forum] as a sample of what is required
// to convert a Microsoft binary format double precision number to
// an IEEE format double. Modified to convert the
// opposite direction by Philip D. Seth.
// Parameters:
// source - pointer to IEEE format double to convert
// dest - pointer to buffer for MBF result
// Return:
// 0 - conversion was successful
// 1 - overflow
// Shared Data:
// none
// Use of Other Routines:
// none
// Assumptions/Cautions:
// The routine assumes that the IEEE double is normalized.
//
// If the IEEE double is NAN (not a number) the routine
// returns zero.
//
{
Mbfd_t ie; // temporary storage for IEEE value
Mbfd_t mb; // will hold converted value
// Copy the number to be converted to a union for easier handling.
ie.d = *source;
// Is the number not a number (NAN)? If so return zero.
if ( _isnan( ie.d ) != 0 ) {
mb.l[0] = 0L;
mb.l[1] = 0L;
*dest = mb.d;
return 0;
}
// I special-case all-zero because the exponent should not
// be biased. Rather, 0 is represented by a pattern of all
// binary zeroes.
if ( ie.d == 0.0 ) {
mb.l[0] = 0L;
mb.l[1] = 0L;
*dest = mb.d;
return 0;
}
// get exponent value & strip sign bit
mb.i[3] = (unsigned short) ie.i[3] >> 4;
mb.i[3] &= 0x7ff;
// mb.i[3] now has an exponent still biased by 1023
// Check to see if the exponent will overflow.
if ( mb.i[3] < 894 || mb.i[3] > 1149 ) {
// exponent is too big or too small - return error.
return 1;
}
// adjust by +1 to compensate for 0.111... vs. 1.111...
mb.i[3] -= 894; // convert to 0x80 bias (-1023 + 128 + 1)
// left-adjust
mb.i[3] <<= 8; // 00000xxxxxxxxxxxx ==> xxxxxxxx00000000
// next line ORs the sign bit into the word containing the exp.
mb.i[3] |= ( ie.i[3] & 0x8000 )? 0x0080: 0x0000;
// next line gets the four bits of mantissa left in the
// exponent word ( 000000000000xxxx ==> 000000000xxxx000
mb.i[3] |= (unsigned short) ( ie.i[3] & 0x000f ) << 3;
// Now we need three more mantissa bits to finish the exponent word.
// We do that by ORing the three highest bits of the next word
// into the low three bits of the exponent word.
mb.i[3] |= (unsigned short) ( ie.i[2] >> 13 );
// The remaining 13 bits of the next word just need to be shifted
// three bits left to begin the low MBF word.
mb.i[2] = (unsigned short) ie.i[2] << 3;
// Now we need three bits from the next word again to finish the
// second MBF word.
mb.i[2] |= (unsigned short) ie.i[1] >> 13;
// To finish we need the last 29 bits of the lower dword
// shifted left three bits to make up the low MBF dword.
mb.l[0] = (unsigned long) ie.l[0] << 3;
// THAT'S IT!
*dest = mb.d;
return 0;
} // End DIeeeToMsbin()
[More]
There is 1 Reply.
==========
mslang/S4_C_C++_Run-Time_Lib #303864, from Philip_D._Seth, 2635 chars,
30-Jan-96
19:21:54
Comment to 303863.
----------
Subject: dmsbintoieee()
Fm: Philip D. Seth 71360,3535
To: Philip D. Seth 71360,3535
[Continued]
----------------------------------------------------------------------------
#include <float.h>
typedef union _mbf_flt_t
{
float f;
unsigned short i[2];
unsigned long l;
} Mbff_t;
int FIeeeToMsbin( float *source, float *dest )
// ---[comments reformatted for line breaks. - felixk]---
// Description:
// This function is based on a function written by Felix A. Kasza
// [MVP on MSLANG Compuserve forum] as a sample of what is required
// to convert a Microsoft binary format double precision number to
// an IEEE format double. Modified to handle a float and convert
// the opposite direction by Philip D. Seth.
// Parameters:
// source - pointer to IEEE format float to convert
// dest - pointer to buffer for MBF result
// Return:
// 0 - conversion was successful
// 1 - overflow
// Shared Data:
// none
// Use of Other Routines:
// none
// Assumptions/Cautions:
// The routine assumes that the IEEE float is normalized.
//
// If the IEEE float is NAN (not a number) the routine
// returns zero.
//
{
Mbff_t ie; // temporary storage for IEEE value
Mbff_t mb; // will hold converted value
// Copy the number to be converted to a union for easier handling.
ie.f = *source;
// Is the number not a number (NAN)? If so return zero.
if ( _isnan( (double) ie.f ) != 0 ) {
mb.l = 0L;
*dest = mb.f;
return 0;
}
// I special-case all-zero because the exponent should not
// be biased. Rather, 0 is represented by a pattern of all
// binary zeroes.
if ( ie.f == 0.0F ) {
mb.l = 0L;
*dest = mb.f;
return 0;
}
// get exponent value & strip sign bit
mb.i[1] = (unsigned short) ie.i[1] >> 7;
mb.i[1] &= 0xff;
// mb.i[1] now has an exponent still biased by 127
// Check to see if the exponent will overflow.
if ( mb.i[1] > 253 ) {
// exponent is too big - return error.
return 1;
}
// adjust by +1 to compensate for 0.111... vs. 1.111...
mb.i[1] += 2; // convert to 0x80 bias (-127 + 128 + 1)
// left-adjust
mb.i[1] <<= 8; // 00000xxxxxxxxxxxx ==> xxxxxxxx00000000
// next line ORs the sign bit into the word containing the exp.
mb.i[1] |= ( ie.i[1] & 0x8000 )? 0x0080: 0x0000;
// next line gets the seven bits of mantissa left in the
// exponent word ( 000000000xxxxxxx )
mb.i[1] |= (unsigned short) ( ie.i[1] & 0x007f );
// The remaining 16 bits of the mantissa just need to be copied.
mb.i[0] = ie.i[0];
// THAT'S IT!
*dest = mb.f;
return 0;
} // End FIeeeToMsbin()
---[end of thread]---
Felix.
Cheers,
Felix.

Paul S. Ganney

ungelesen,
03.11.1997, 03:00:0003.11.97
an

In my version of VC++ (1.00), there's a function called
_fieeetomsbin() which converts IEEE format floats into MS format ones.
It doesn't appear to be in VC++ 5.00. Any ideas what happened to it?

Paul.
-------------------------------------------
Expressed opinions are usually my own.
Especially if they're any good (of course).
-------------------------------------------

Paul S. Ganney

ungelesen,
04.11.1997, 03:00:0004.11.97
an

ZZ Top <Now...@nowhen.net> wrote:

>Gone the way of the dinosaurs, perhaps. The "MS" float format is long
>obsolete; the I86s use IEEE now...

Thanks. In which case I probably don't need it. I'm trying to load a
data file created on a UNIX box into a PC app. The ints are OK (being
a simple byte-swap) but the floats aren't.

Any ideas?

Pete Barrett

ungelesen,
04.11.1997, 03:00:0004.11.97
an

On Mon, 03 Nov 1997 15:40:01 GMT, paul....@dial.pipex.com (Paul S. Ganney)
wrote:

>In my version of VC++ (1.00), there's a function called
>_fieeetomsbin() which converts IEEE format floats into MS format ones.
>It doesn't appear to be in VC++ 5.00. Any ideas what happened to it?
>

I think you'll find that VC++ 5 uses IEEE format floating point numbers, so
doesn't need a conversion routine.

Pete Barett


Dan Vallejo@Microsoft.com

ungelesen,
07.11.1997, 03:00:0007.11.97
an

Are you sure their floats and not doubles?
Also, are you sure that the Unix data structures are packed the same way as
on the PC?
--
Microsoft Money Software Developer
The opinions expressed in this message are my own
and do not reflect the official views of Microsoft Corporation.


Paul S. Ganney <paul....@dial.pipex.com> wrote in article
<345f37c5...@news.dial.pipex.com>...
> ZZ Top <Now...@nowhen.net> wrote:


>
> >Paul S. Ganney wrote:
> >>
> >> In my version of VC++ (1.00), there's a function called
> >> _fieeetomsbin() which converts IEEE format floats into MS format ones.
> >> It doesn't appear to be in VC++ 5.00. Any ideas what happened to it?
> >>

Paul S. Ganney

ungelesen,
07.11.1997, 03:00:0007.11.97
an

"Dan Val...@Microsoft.com" <---dan...@microsoft.com> wrote:

>Are you sure their floats and not doubles?

Good point. I shall check..


>Also, are you sure that the Unix data structures are packed the same way as
>on the PC?

Pretty certain, as the structures were provided by the guy who wrote
the data out.

Ta

Dan Vallejo@Microsoft.com

ungelesen,
07.11.1997, 03:00:0007.11.97
an

Give some sample code and such.
I still think it might be a packing problem. Unix might be packing on a
word boundary whereas VC might be packing on byte boundaries.

--
Microsoft Money Software Developer
The opinions expressed in this message are my own
and do not reflect the official views of Microsoft Corporation.


Paul S. Ganney <paul....@dial.pipex.com> wrote in article

<346330fb...@news.dial.pipex.com>...

0 neue Nachrichten