From bug-request at octave dot org Fri Dec 10 17:27:31 2004 Subject: (0-3*i)/inf gives NaN instead of 0 From: Schloegl Alois To: bug at octave dot org Date: Sat, 11 Dec 2004 00:21:44 +0100 Bug report for Octave 2.1.64 configured for i686-pc-linux-gnu Description: ----------- octave:4> version ans = 2.1.64 octave:5> (4-3*i)/inf ans = NaN - NaNi The correct result is 0. Actually, Octave 2.1.33 (on a different platform) does not seem to have this problem. octave:7> version ans = 2.1.33 octave:8> (4-3*i)/inf ans = 0 Repeat-By: --------- * Please replace this item with a description of the sequence of events that causes the problem to occur. Fix: --- Prof. W .Kahan mentions in his "Lecture Notes on the Status of IEEE 754" p.10 http://www.cs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF "when (0+3i)/inf is turned naively into (0+3i)*(inf-i)/(inf^2+0^2) it generates a NaN instead of the expected 0." Alois ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------