www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/11/21/12:59:22

Subject: HUGE_VAL and SIGFPE for djgpp?
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Sat, 21 Nov 92 10:30:41 MST
From: Scott Raney <raney AT metacard DOT com>

  We've got an interpreter that needs to check floating point values
for overflow and to catch divide by zero.  On (most) UNIX systems, an
overflow can be detected by comparing the result with HUGE_VAL, and a
floating point divide by zero causes a signal(SIGFPE).

  With djgpp (1.08), comparing a double against MAXDOUBLE and dividing
by zero both cause an error trap (in fact, the *compiler* exits when
trying to evaluate expressions like "double a = 10.0 / 0.0;").  This
error trap also locks up DESQview/X :-(

  Is there any way to catch this error, and is there any way to check
for overflow?
  Thanks in advance for any information,
    Scott

-- 
***********************************************************************
* Scott Raney  303-447-3936            Remember: the better you look, *
* raney AT metacard DOT com                   the more you'll see -- Lidia   *
***********************************************************************

- Raw text -


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