delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/23/05:19:46

From: G DOT DegliEsposti AT ads DOT it
To: djgpp AT delorie DOT com
Message-ID: <C12565B4.0033C84B.00@vega.ads.it>
Date: Mon, 23 Feb 1998 10:30:44 +0100
Subject: Re: sqrt() in DJGPP
Mime-Version: 1.0




>> > 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.

I don't think this is the problem, since he is doing the sqrt() of a surely
positive quantity and the crash happens on a different line :-)

Maybe A / Distance gives a number too big (or too small) to fit within
Normal.X ?

What are the datatypes of the variables involved in the problem?

ciao
  Giacomo



- Raw text -


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