Mail Archives: djgpp/1998/02/19/21:47:34
From: | "Lucas Panian" <mpanian AT awinc DOT com>
|
Subject: | sqrt() in DJGPP
|
Newsgroups: | comp.os.msdos.djgpp
|
Message-ID: | <01bd3da9$a0052120$0cf234d1@mpanian.awinc.com>
|
NNTP-Posting-Host: | ts1-11.nelson.wkpowerlink.com
|
Date: | 20 Feb 98 02:44:39 GMT
|
Lines: | 30
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
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.
Normal.Y = (B / Distance) + VPoint[0]->Ly;
Normal.Z = (C / Distance) + VPoint[0]->Lz;
I'm pretty sure SIGFPE is a 'Not-A-Number' error. I'm pretty sure the bad
number is 'Distance.'(have done a little bit of detective work...). So,
they only thing I can think of is an error in the return value of the
sqrt() function. Am I right in this assumption? Any help would be greatly
appreciated. Thanks. ;)
Luke
--
Lucas A. Panian
mpanian AT awinc DOT com
Venus Isles LPMUD - shell.chaven.com : 9999
- Raw text -