🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Microsoft C actually does something better!

#4535
From: Kevin D. Quitt
Date: Tue, 05 Feb 1991 18:40
26 lines
1822 bytes
In article <1991Feb5.020455.26710@maytag.waterloo.edu> dmurdoch@watstat.waterloo.edu (Duncan Murdoch) writes:
>In article <8904@sail.LABS.TEK.COM> toma@sail.LABS.TEK.COM (Tom Almy) writes:
>>Microsoft C has been bad-mouthed here by myself and others over the years,
>>but this past weekend I discovered at least one place where it beats the
>>major competition -- the math library. Two cases:
>>
>>Case 1: { double x=1e200; printf("%g",x*x); }
>>(With some compilers, the 80x87 has to have the overflow trap masked off).
>
>I tried your tests in Turbo Pascal 6.0, and was pleasantly surprised at the
>results.  (TP 6.0 has some real problems with esoteric floating point code.)
>>
>>Microsoft C (V6.00A): prints +inf	(correct!)
>
>MSC may be correct for C, but TP prints 1.00000000E+0400, which is even more
>correct.  (This is because TP promotes expressions to the 10 byte extended 
>type.)  When I forced the result to go into a double, I got an overflow 
>error; when I masked those, I got INF.

    It's more correct mathematically, but not according to the C language
spec.  There *are* (non-standard) ways in MSC to use the 10-byte reals.
-- 
 _
Kevin D. Quitt         demott!kdq   kdq@demott.com
DeMott Electronics Co. 14707 Keswick St.   Van Nuys, CA 91405-1266
VOICE (818) 988-4975   FAX (818) 997-1190  MODEM (818) 997-4496 PEP last
Technical Details
Message-ID: <1991Feb5.184015.9539@demott.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!srhqla!demott!kdq
References: <8904@sail.LABS.TEK.COM> <1991Feb5.020455.26710@maytag.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!srhqla!demott!kdq
From: kdq@demott.com (Kevin D. Quitt)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Microsoft C actually does something better!
Message-ID: <1991Feb5.184015.9539@demott.com>
Date: 5 Feb 91 18:40:15 GMT
References: <8904@sail.LABS.TEK.COM> <1991Feb5.020455.26710@maytag.waterloo.edu>
Organization: DeMott Electronics Co., Van Nuys CA
Lines: 26