From bug-octave-request at bevo dot che dot wisc dot edu Sun Nov 1 10:19:25 1998 Subject: Unidentified subject! From: "John W. Eaton" To: john Cc: bug-octave at bevo dot che dot wisc dot edu Date: Sun, 1 Nov 1998 10:19:06 -0600 (CST) On 1-Nov-1998, john wrote: | Bug report for Octave 2.0.13 configured for i586-pc-linux-gnulibc1 | finite(horrible complex NaN thing) gives unexpected answer | | Repeat-By: | --------- | | octave:1> a = [13, Inf, NaN+i*NaN] ; | octave:2> a | a = | | 13 + 0i Inf + 0i NaN + NaNi | | octave:3> finite(a) | ans = | | 1 0 1 Please try the following patch. Thanks, jwe Sun Nov 1 10:10:40 1998 John W. Eaton * lo-mappers.cc (xfinite): Define in terms of xfinite for real and imaginary parts. (xisinf): Define in terms of xisinf for real and imaginary parts. *** liboctave/lo-mappers.cc~ Thu Feb 19 01:18:45 1998 --- liboctave/lo-mappers.cc Sun Nov 1 10:04:17 1998 *************** *** 189,201 **** { double rx = real (x); double ix = imag (x); ! return (double) (! ((int) xisinf (rx) || (int) xisinf (ix))); } double xisinf (const Complex& x) { ! return (double) (! (int) xfinite (x)); } // Complex -> complex mappers. --- 189,203 ---- { double rx = real (x); double ix = imag (x); ! return (double) ((int) xfinite (rx) && (int) xfinite (ix)); } double xisinf (const Complex& x) { ! double rx = real (x); ! double ix = imag (x); ! return (double) ((int) xisinf (rx) || (int) xisinf (ix)); } // Complex -> complex mappers.