Mail Archives: djgpp/1998/04/23/12:23:18
I have this problem with SIGFPE...
double DistanceBetweenPoints(strPOINT *Pt1, strPOINT *Pt2)
{
double Dist;
Dist = pow(fixtof(Pt1->X - Pt2->X), 2)+
pow(fixtof(Pt1->X - Pt2->X), 2)+
pow(fixtof(Pt1->X - Pt2->X), 2);
Dist = sqrt(Dist);
printf("Dist = %f\n", Dist); <----- program crashes here with SIGFPE
}
traceback:
_doprnt+3548
_doprnt+1574
printf+20
DistanceBetweenPoints
and I #included math.h
Why would SIGFPE appear in a mere printf ?
What causes SIGFPE anyway ?
If I remove the printf, I get SIGFPE at "if (Dist1[I] <= Dist2[J])"
(Dist1[6] and Dist2[6] are float)
- Raw text -