From bug-octave-request at bevo dot che dot wisc dot edu Wed Sep 6 14:16:41 2000 Subject: real(Inf+Inf*i) vs imag(Inf+Inf*i) asymmetry From: Rolf Fabian To: "'bug-octave UWISC'" Date: Wed, 6 Sep 2000 14:17:23 -0500 (CDT) Hi, For my :>version |- 2.1.14 (OS/2) installation, I observe the following 'asymmetry' between imag(x) and real(x) for no-finite input x. I'm afraid that the problem also occurs with current V2.1.31 ------ IMAG ------- :1>imag(Inf*i) |- Inf OK :2>imag(Inf+Inf*i) |- Inf OK :3>imag(Inf) |- 0 OK ------ REAL ------- :1>real(Inf) |- Inf OK :2>real(Inf+Inf*i) |- NaN << :3>real(Inf*i) |- NaN << In my eyes, the above 'imag' returns are correct, whereas the '<<' are erraneous. The problem seems NOT to come from 'real'. The underlying reason seems to be, that the following assignment is automatically converted :>x=Inf+Inf*i |- ans x=NaN+Inf*i << to a NaN real part, with the consequence that :>isnan(real(x)) |- ans=1 :>isnan(imag(x)) |- ans=0 results, which leads to the imag/real asymmetry demonstrated above. Rolf ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------