automatic Inf+NaN*i conversion
Rolf Fabian
Rolf.Fabian at gmx.de
Fri Apr 25 08:42:47 CDT 2008
> Datum: Fri, 25 Apr 2008 13:49:56 +0200
> Von: "Jaroslav Hajek" <highegg at gmail.com>
> An: "Rolf Fabian" <Rolf.Fabian at gmx.de>
> CC: bug-octave at octave.org
> Betreff: Re: automatic Inf+NaN*i conversion
> The rest, as you have suspected, is intended behaviour, given by the
> fact that `Inf' and `NaN' are functions.You can construct exceptional
> complex numbers reliably using `complex'.
>
> > octave-3.0.0.exe:2> isnan(x)
> > ans =
> > 1 1 # agree
> >
> > Checking x for finiteness :
> > octave-3.0.0.exe:3> finite (x)
> > ans =
> > 0 0 # agree
> >
> > But the result of the following check contradicts
> > above result because 1st element of x cannot be
> > neither finite nor infinite !
>
> I believe that's exactly true for NaN - it is neither finite nor
> infinite. What support do you have for the opposite claim?
Maybe I've not been precise enough, but it seems to me that you
didn't get my point yet:
octave-3.0.0.exe:> isinf(Inf+NaN*i) |- ans = 0
octave-3.0.0.exe:> isinf(NaN+Inf*i) |- ans = 1
Thus NaN+Inf*i is considered to be finite by Octave,
but Inf+NaN*i is NOT considered to be finite by Octave as:
I expect that either BOTH of them are considered (by definition)
as infinite, or BOTH of them as finite, but the appearing
'mixed case' is the worst case selection.
If we compare to the isnan function
for the same arguments as above :
octave-3.0.0.exe:> isnan(Inf+NaN*i)
ans = 1
octave-3.0.0.exe:> isnan(NaN+Inf*i)
ans = 1
we get get a unique result no matter whether the
NaN appears in the real part or the imag part.
I don't see any mathematical necessity to differentiate
between the outputs of
octave-3.0.0.exe:> isinf(Inf+NaN*i) |- ans = 0
octave-3.0.0.exe:> isinf(NaN+Inf*i) |- ans = 1
and there are further arguments against that than just
simply saying that this definition 'breaks symmetry'.
Ben already pointed out that ML has the same 'feature'
implemented. Thus, from former experience, it makes
absolutely no sense for me to dig publicly further into
this matter because I believe to already know the majority
of your eventual comments and replies in advance.
R:
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
More information about the Bug-octave
mailing list