delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/25/06:45:59

From: enlar AT hidespam DOT iname DOT com (Eneko Lacunza)
Newsgroups: comp.os.msdos.djgpp
Subject: Help - Floating Point Exception
Date: Thu, 24 Sep 1998 21:37:45 +0200
Organization: Telefonica Transmision de Datos
Lines: 43
Message-ID: <GoldED.199809242144148700.enlar@hidespam.iname.com>
NNTP-Posting-Host: infon56.jet.es
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Path: news.vitts.com!news-pen-2.sprintlink.net!news-east.sprintlink.net!news-peer.sprintlink.net!news.sprintlink.net!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newspeer.monmouth.com!newsfeed.mad.ibernet.es!news.mad.ibernet.es!not-for-mail
Xref: news.vitts.com comp.os.msdos.djgpp:31276

Hello All!

    I'm having some problems with the following code:

=== Cut ===
#define pi 3.1415926535897932385

void build_table(void)
{
unsigned short xcont,ycont;
float radio,angulo;

     for(ycont=0;ycont<200;ycont++)
         for(xcont=0;xcont<320;xcont++)
         {
             radio=sqrt((xcont-160)*(xcont-160)+(100-ycont)*(100-ycont));
             angulo=atan2((xcont-160),(100-ycont));

             table[xcont][ycont][0]=floor(radio);
             table[xcont][ycont][1]=floor(255*angulo/(2*pi)); // FPE
         }
}
=== Cut ===

    This crashes at the point noted as //FPE with a Floating Point
exception. This is quite tricky, because it doesn't crash in a shell (i.e.
running it under rhide) and if I try to redir the crash, redir crashes when 
the program has finished the above code and is doing something else.

    Could somebody tell me what does that exception mean, and how could I
fix it (if this info is enough). I'm using GCC 2.7.2...

    Any help would be appreciated.

Regards,

Eneko Lacunza.
enlar/Genesis

Fidonet 2:344/19.11  Fidonet forever!
e-mail  strip hidespam. from header's address
http    web.jet.es/enlar

- Raw text -


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