www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/28/08:15:37

From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: division by 0
Date: Wed, 28 Jan 1998 14:05:45 +0100
Organization: Lehrstuhl fuer Stroemungsmechanik
Lines: 42
Message-ID: <34CF2D28.D4675969@LSTM.Ruhr-UNI-Bochum.De>
References: <34CF2295 DOT 7457 AT quantum DOT de>
NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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