Path: utzoo!attcan!uunet!samsung!olivea!apple!bionet!ames!pacbell.com!pacbell!osc!jgk From: jgk@osc.COM (Joe Keane) Newsgroups: comp.arch Subject: Re: Alignment on RS/6000 Summary: Exceptional numbers are useful. Message-ID: <4047@osc.COM> Date: 30 Nov 90 01:55:13 GMT References: <893@sibyl.eleceng.ua.OZ> <46760@apple.Apple.COM> <897@sibyl.eleceng.ua.OZ> Reply-To: jgk@osc.COM (Joe Keane) Organization: Versant Object Technology, Menlo Park, CA Lines: 26 In article <46760@apple.Apple.COM> baum@apple.UUCP (Allen Baum) writes: >Its always been my impression that NaN, Inf, and Denorms were reasonably >rare- they don't usually occur. Is this not the case? Are there statistics >somewhere that show how often these cases occur? In article <897@sibyl.eleceng.ua.OZ> ian@sibyl.OZ (Ian Dall) writes: >In a well behaved program they are extremely rare. Therefore, if they occur >you almost certainly have a bug and you might as well core dump. Once one >occurs, they tend to be contageous, so that soon your program is trapping >on every floating point operation. *That* is what makes it take "forever". > >The output of such a program is useless. The results are meaningless and >worse, they give you no clue as to where the problem might be. A core dump >is preferable except maybe in commercial software, and even then it only >gives an illusion of robustness. Ugh, i don't agree with any of this. Real functions (exp, log, etc.) have points at which the result is infinite or undefined. There's no way to avoid this; the question is, how do you want to deal with it? The results are certainly not meaningless, the whole point of IEEE exceptional values is that such exceptional values are handled in a reasonable way. These conditions can be tested for by the program and an appropriate action taken. Now maybe many simple programs don't want to deal with such conditions in an intelligent way, and dumping core is an acceptable solution. If i was using a spreadsheet or calculator program and it dumped core on me, then i'd be mad at the author for such a dumb program. Brought to you by Super Global Mega Corp .com