🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by gerry wiener Sat, 02 Dec 1989 01:20
(double) bug using g++-1.36.1 on sun4-os4.0.3
#661
Author: gerry wiener
Date: Sat, 02 Dec 1989 01:20
38 lines
1233 bytes
When the program below is compiled and executed, it produces the
following output:

(many lines omitted)
e = 8.98847e+307, f = 4.49423e+307
e = Inf, f = 8.98847e+307
e = Inf, f = Inf

When the two lines containing cout are uncommented and the printf
line is commented, the following output is produced:

(many lines omitted)
e is 8.98847e+307
f is 4.49423e+30

and the program hangs.  A similar problem occurs when double is
changed to float.
------------------------------------------------------------------------
#include <stream.h>

main()
{
  double e;
  double f;

  e = 2;
  f = 1;

  /* make larger */
  while (e > f)
    {
      e *= 2;
      f *= 2;
      printf("e = %g, f = %g\n", e, f);
/*      cout << "e is " << e << '\n';
      cout << "f is " << f << '\n';*/
    }
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads