Mail Archives: djgpp/1998/01/28/08:15:37
Tom Chojnacki wrote:
>
> 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.
Hmm, not sure about v1..
But usually you can set the exception mask with _control87().
Try
info libc alpha _control87
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -