Date: Fri, 24 Feb 1995 03:54:29 -0400 (AST) From: Bill Davidson Subject: Re: strange fp exception To: Erwin Kok Cc: djgpp AT sun DOT soe DOT clarkson DOT edu On Thu, 23 Feb 1995, Erwin Kok wrote: > A while ago I had a similar fp-exception: > > I made up a program compiled it and it worked (under DJGPP FPU-emulation), > but when I bought a co-processor, I compiled it and a strange floating-point > exception appeared... > > After a few debugging hours I found that the result from an arithmetic > statement was NAN (Not A Number), and when you do another statement with a NAN > an exception appears. So, the FPU-emulator under DJGPP didn't had a problem with > a NAN it runned right through it. But the real FPU didn't except the NAN and > gave an exception. So maybe MSC ran through some NAN and when you ported it to > DJGPP/GRX the exception appeared. > > My advise is check if any variabeles are NAN's. A couple of weeks ago (?) someone posted a lovely little ctrl87.c program that allows one to diddle the '87 control word. It works like a charm and allows one to do just this sort of thing without resorting to asm. Bill Davidson bdavidson AT ra DOT isisnet DOT com