Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: Mircosoft C V5.1 floating point problem. Message-ID: <394@taumet.com> Date: 9 Aug 90 15:57:53 GMT References: <5587@castle.ed.ac.uk> Organization: Taumetric Corporation, San Diego Lines: 21 NaN (not-a-number) is a well-defined concept in IEEE floating-point. Some arithmetic operations are undefined, such as 0.0 / 0.0 Infinity * 0.0 Infinity / Infinity Since no number can be the result of such an operation, NaN is the result. NaN and +/- Infinity each have a special bit pattern which is reserved for that use, and cannot be the result of any valid numerical operation. Infinity is usually the result of an overflow. Dividing by Infinity always results in zero (except for Infinity and NaN). The result of any operation involving a NaN is a NaN. That is, Infinities and NaNs propogate so that an expression which fails at some point during its evaluation doesn't suddenly wind up with an ordinary numerical value. So you may have some calculation which overflows, or otherwise has an invalid operation, possibly in an intermediate result. Floating-point expressions are not always evaluated in the order in which you expect, and intermediate overflows are possible. -- Steve Clamage, TauMetric Corp, steve@taumet.com