Re^2: Turbo C 2.0 vs MSC 5.1

ody davidsen at sungod.crd.ge.com
Sat Aug 12 00:33:41 AEST 1989


In article <1989Aug9.094742.20000 at gdt.bath.ac.uk> exspes at gdr.bath.ac.uk (P E Smee) writes:

| A bad move, I'd have said.  It is not difficult to think of cases where
| 'a/b/c/d/e' would give a sensible answer, while 'a/(b*c*d*e)' will
| overflow computing the denominator '(b*c*d*e)' and so give nonsense.

  Could you give us an example? Looking at the conditions it sure looks
as though even by avoiding the overflow you would be doing the
equivalent operations and would get an underflow on one of the divides.
I was also able to come up with values which give zero significant
digits without getting a trap.

  I can come up with a few cases where the order of operations was
important (ie big # times fraction times big # doesn't overflow, big #
time big # does, before the fraction). That's a diferent problem, since
order is needed for either multiplication or division.

  I assume that when you said "sensible answer" you meant "correct to
some useful number of digits" rathar than "avoids hardware errors."

	bill davidsen		(davidsen at crdos1.crd.GE.COM)
  {uunet | philabs}!crdgw1!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.lang.c mailing list