home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!vnet.ibm.com
- From: dmm@vnet.ibm.com (Dave Mooney)
- Message-ID: <19930124.150334.898@almaden.ibm.com>
- Date: Sun, 24 Jan 93 18:02:15 EST
- Newsgroups: comp.os.os2.programmer
- Subject: Re: Floating point underflow
- Organization: IBM Canada Lab
- News-Software: UReply 3.0
- References: <1430.1034.uupcb@idcbbs.com>
- Lines: 22
-
- In <1430.1034.uupcb@idcbbs.com> Claudio Fahey writes:
- > I'm trying to write a program with the IBM C Set/2. Every
- > once in a while, the program just terminates when I perform
- > a specific action. IPMD ( the debugger ) tells me that it
- > gets a floating point underflow on a line such as this:
- > LONG rc; float Temp;
- > rc = Temp * NUMCOLORS/MAXTEMP;
- > When I trace into it, Temp is around 1e-40 and NUMCOLORS/MAXTEMP is
- > around 0.93. Why is it giving me this error? Why doesn't it just
- > set rc to 0? How can I avoid this problem? Thanks.
-
- Underflow trapping is set on by default. To turn it off, add the
- following line to your program:
-
- _control87( EM_UNDERFLOW, EM_UNDERFLOW );
-
- dave
-
- -------------------------------------------------------------------------
- Dave Mooney dmm@vnet.ibm.com
- C Set/2 Development, IBM Canada Lab, 844 Don Mills Rd, Toronto, Ontario
- "Now we can talk to cheese anywhere in the world!!!"
-