Date: Wed, 1 Apr 1998 11:22:49 +0300 (IDT) From: Eli Zaretskii To: Alan Carter cc: djgpp AT delorie DOT com Subject: Re: ATAN causing FP Exception In-Reply-To: <01bd5ca7$c0918ce0$395008c3@alan> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 31 Mar 1998, Alan Carter wrote: > float xlen,ylen,ang,res,sub; > res=sub=xlen=ylen=ang=0; > > xlen=fabs(x1-x2); > ylen=fabs(y1-y2); > > res=xlen/ylen; > > sub=atan(res); // << -- this is the little bugger causing You pass a float argument to `atan', which expects a double. GCC will perform the conversion for you, but only if your source file says #include somewhere. If you didn't do that, that's why it crashes. Also, it's a good idea to use the -Wall switch to GCC, it will catch many such bugs in embryo.