[comp.unix.ultrix] Ultrix 2.0 cc G floating point

tp@td2cad.UUCP (t patterson) (05/04/88)

    more fun with Ultrix compilers!!

    we have several people who want to use G floating point format on the
ol' VAX (they need it, believe me). According to the Ultrix manual, no
problem.
    According to reality, there's a problem.

    at first, I thought I was reading the manual incorrectly, but I did
get a test case which died with cc and not with vcc.
    (I haven't yet filed an SPR on this, though we have talked with DEC
Software Support, with little tangible results.)

    (btw, this is Ultrix 2.0 on a 780)
    anyway, the gory evidence:

Script started on Tue Apr 26 15:40:50 1988
td2> mk gfloat.c
+ cc -Mg -o gfloat gfloat.c -lmg
td2> gfloat
a=1.701412e+038
b=1.000000e+030
c=1.701412e+008
td2> vcc -Mg -o vfloat gfloat.c -lmg
td2> vfloat
a=1.500000e+045
b=1.000000e+030
c=1.500000e+015
td2> cat gfloat.c
/*
 * $Compile: cc -Mg -o gfloat gfloat.c -lmg
 */
main()
{
	double a, b, c;

	a = 1.5e45;
	b = 1.0e30;
	c = a / b;
	printf("a=%e\n", a);
	printf("b=%e\n", b);
	printf("c=%e\n", c);
}

td2> ^D
script done on Tue Apr 26 15:41:35 1988

    the results for cc make some sense... if you consider silently
truncating numbers to be a sensible thing, but it doesn't look like it
supports G floating point to me (unless I've misread things).

    (note: using vcc is not an option, since it has unfixed bugs which
break our programs also ... there isn't much choice in this matter, given
that we are forced to use DEC equipment).

    I don't expect any useful answers to this (unless someone can tell me
if I screwed this up), but this is mostly intended as a warning against
trusting your c compiler.
--
  ..tp.. t patterson			path: {ihnp4,uunet}!wucs1!td2cad!tp
					      OR {pyramid,hoptoad}!td2cad!tp
domain: tp%td2cad.intel.com@relay.cs.net      OR decwrl!intelca!mipos3!td2cad!tp