www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/30/12:50:45

Date: Sun, 30 Jun 1996 22:58:59 -0800 (GMT)
From: "Rafael R. Sevilla" <rsevilla AT upd DOT edu DOT ph>
To: DJGPP Mail Server <djgpp AT delorie DOT com>
Subject: Floating point exceptions
Message-ID: <Pine.SOL.3.91.960625233137.905A-100000@sauron>
MIME-Version: 1.0

Is there something different about the way Sparcs and Pentiums handle
floating point exceptions? I've been developing a ray tracer portable
between djgpp, Solaris 5.3, and Linux, and the Pentium versions (djgpp and
Linux) seem to not work the same way as the Sun version. In particular the
Sparc seems to forget that it's dividing by zero somewhere! There's a
portion of code in the ray tracer that inverts a 3x3 matrix, and one of my
scenes happens to create a matrix that has a zero determinant. The Sparc
eats it, no sweat, and presses on without telling me anything! Since I use
curses with it, I have a signal handler that takes care of such things,
lest I mess up the screen, but I don't get a word from the Sparc. Can
anyone tell me anything about this rather odd behavior? Must I explicitly 
check for division by zero everywhere just to ensure that my code acts 
the same way across all platforms?

-------------------------------------------------------------------------
University of the Philippines                           Rafael R. Sevilla
PABX/OVCA: Diliman Networking Project          rsevilla AT sauron DOT upd DOT edu DOT ph
-------------------------------------------------------------------------

P.S.: The Sun's compiler is gcc 2.7.2.f1.

- Raw text -


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