www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/07/15:49:26

From: Charles Sandmann <sandmann AT new-orleans DOT NeoSoft DOT com>
Subject: Re: How to use Inf and NaN?
To: bdavidson AT ra DOT isisnet DOT com (Bill Davidson)
Date: Tue, 7 Feb 1995 08:02:13 -0600 (CST)
Cc: D-PAPP AT nov DOT mht DOT bme DOT hu, djgpp AT sun DOT soe DOT clarkson DOT edu

> I haven't seen any replies posted, so, with much trepidation, I decided 
> to take a look at this problem.
> I thought the ANSI standard signal() function might be a good approach, 

This is available in V2, but still in this case would not be the 
answer probably.  You will get control, but trying to interpet the 
current FPU state and executing instruction will drive you crazy.

> That leaves assembly language, and modifying the FPU contol word to mask 
> off certain exceptions, including divide by zero and whatever other 
> conditions could result in a NaN.  Then no exceptions will be generated.  

This is probably the correct answer.  As a matter of fact, the default state
is all masked, but GO32 sets the current mask in the 80387 detection routine.
This can be done with a simple inline assembler call, but I don't have any
X87 doc here now.  


- Raw text -


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