From: martin AT REMOVE_THIS_BITloplop DOT com (Martin Peach) Newsgroups: comp.os.msdos.djgpp Subject: Re: sqrt() in DJGPP Date: Sun, 22 Feb 1998 16:39:02 -0500 Organization: LopLop Inc. Lines: 24 Message-ID: References: <01bd3da9$a0052120$0cf234d1 AT mpanian DOT awinc DOT com> <34ED4ECB DOT 5A5C0CBC AT LSTM DOT Ruhr-UNI-Bochum DOT De> NNTP-Posting-Host: dialup-738.hip.cam.org To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <34ED4ECB DOT 5A5C0CBC AT LSTM DOT Ruhr-UNI-Bochum DOT De>, Thomas Demmer wrote: > Lucas Panian wrote: > > > > Hi, > > > > When I try to run my program, it crashes with SIGFPE...I used symify to > > find that it was in the following section of code(all variables are already > > declared) > > > > A = Y1 * ( Z2 - Z3 ) + Y2 * ( Z3 - Z1 ) + Y3 * ( Z1 - Z2 ); > > B = Z1 * ( X2 - X3 ) + Z2 * ( X3 - X1 ) + Z3 * ( X1 - X2 ); > > C = X1 * ( Y2 - Y3 ) + X1 * ( Y3 - Y1 ) + X3 * ( Y1 - Y2 ); > > > > Distance = sqrt (A*A + B*B + C*C); > > > > Normal.X = (A / Distance) + VPoint[0]->Lx; // It crashes on this line. Is A a positive number? Square roots of negative numbers are not defined. Martin. -- ___________/\/\/\/\/\/*=