delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/11/04/08:13:30

From: Kbwms AT aol DOT com
Message-ID: <4e24e38c.364052ac@aol.com>
Date: Wed, 4 Nov 1998 08:12:12 EST
To: eliz AT is DOT elta DOT co DOT il
Cc: djgpp-workers AT delorie DOT com
Mime-Version: 1.0
Subject: Re: Inlining math functions and ANSI/Posix
X-Mailer: AOL 3.0 16-bit for Windows sub 38
Reply-To: djgpp-workers AT delorie DOT com

Subj:	 Re: Inlining math functions and ANSI/Posix
To:	eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
CC:	djgpp-workers AT delorie DOT com

Dear Eli Zaretskii,

> This is all perfectly okay, except that if some of the exceptions are
> not masked, sqrt(-1) should trigger an FP exception and crash the
> program before all this cleverness has a chance to execute.  v2.02
> startup code masks all exceptions, but what if an application unmasks
> some of them?
>
> Can you modify this program to unmask exceptions (by a call to
> `_control87') before the call to `sqrt', and see what happens?
>

Added _control87(0, 0x7777) before the call to `sqrt'.

As you suspected, the program crashes with a floating point exception
error.

> If it does crash, I wonder if we should do anything about it.  At
> least some comment in the docs seems to be due.

Hmmm.


K.B. Williams

- Raw text -


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