🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7865

Re: Microsoft Binary Format

#7865
From: Glen Blankenship
Date: Tue, 22 Aug 1995 20:08
32 lines
1889 bytes
Bob Stout (bobstout@neosoft.com) wrote:

> The following, from SNIPPETS, is TTBOMK, correct...
>
> /***  MSBIN conversion routines    ***/
> /***  public domain by Jeffery Foy ***/

[snip]

No, this is even worse than the Borland routine, since it doesn't even 
return zero when the MSBIN exponent is zero.  The line:

>       exp  = (t.uc[3] - 0x81 + 0x7f) & 0xff;

...will produce erroneous results any time the value of t.uc[3] is less
than or equal to 2.  It will return incorrect values not only for very
small numbers (like the Borland function), but also for the value 0. 

(Note that my correction to the Borland routine used "less than 2" when it
should have used "less than or equal to 2".   My apologies for the error.)

In addition, the IEEEtoMSBIN routine has no provision for reporting overflow
if the IEEE number is too large to fit in the MSBIN format.

(The MS and Borland routines take pointers to both the number to be 
converted and a float to hold the result, and indicate success or overflow 
via the value of the function return.  The IEEEtoMSBIN routine simply 
returns an incorrect result in the event of overflow.)

---
Glen Blankenship
obother@netcom.com
Technical Details
Message-ID: <obotherDDqAM1.KqD@netcom.com>
Path: arc1-ca.pugleaf.net!netcom.com!obother
References: <41a5ft$hfi@netnews.upenn.edu> <obotherDDo8oz.JIr@netcom.com> <Pine.BSD.3.91.950821170512.5980A-100000@Starbase.NeoSoft.COM>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer,comp.os.msdos.misc,comp.os.ms-windows.programmer,comp.lang.c,comp.lang.pascal
Path: arc1-ca.pugleaf.net!netcom.com!obother
From: obother@netcom.com (Glen Blankenship)
Subject: Re: Microsoft Binary Format
Message-ID: <obotherDDqAM1.KqD@netcom.com>
Followup-To: comp.os.msdos.programmer,comp.os.msdos.misc,comp.os.ms-windows.programmer,comp.lang.c,comp.lang.pascal
Organization: Church of the Holy Toy
X-Newsreader: TIN [version 1.2 PL1]
References: <41a5ft$hfi@netnews.upenn.edu> <obotherDDo8oz.JIr@netcom.com> <Pine.BSD.3.91.950821170512.5980A-100000@Starbase.NeoSoft.COM>
Date: Tue, 22 Aug 1995 20:08:25 GMT
Sender: obother@netcom16.netcom.com