www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/28/07:22:10

Message-ID: <34CF2295.7457@quantum.de>
Date: Wed, 28 Jan 1998 13:20:37 +0100
From: Tom Chojnacki <chojnack AT quantum DOT de>
Reply-To: chojnack AT quantum DOT de
Organization: Quantum Software GmbH, Dortmund, Germany
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: division by 0

I have a little problem.
When I try to perform following code:

main()
{
double a = 0.0, b;

  b = 1./a;
  printf("b==%lf\n", b);
}

my program exits and I get "Floating Point exception".
Is there any way to cause that my program not to stop after
division by zero.
I have tried the same in "Visual C++ 5.0" and it didn't exit,
as the result i got:
b==1.#INF00

I use gcc v2.6.3 and go32 v1.12. I know that version is no longer
supported but maybe the same problem occurs in djgpp v2.

Thanks, Tom Chojnacki

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019