From bug-request at octave dot org Mon Feb 7 09:10:48 2005 Subject: Re: Inconsistency in complex division by zero From: Gabriele Pannocchia To: Andy Adler Cc: bug at octave dot org Date: Mon, 07 Feb 2005 15:07:40 +0000 Hi Matlab 7.0sp1 returns to me: >> 1i/0 Warning: Divide by zero. ans =3D NaN + Infi i.e. with a "+" for the imaginary part. Since 1/0 returns (either in octave and matlab) >> 1/0 Warning: Divide by zero. ans =3D Inf I think the correct answer should be : ans =3D NaN + Infi Cheers, Gabriele >=20 > > There is an inconsistency in the division by zero between octave =20 > and > > matlab. Consider 1i/0 that returns "NaN - NaNi" for octave and "NaN > > -Infi" for matlab. The Matlab return value makes much more sense > that > > the octave one as it treats the real and imaginary parts > separately.. > > Tested against octave 2.1.64 and matlab 7.0sp1. >=20 > Matlab 6.5 gives: > >> 1i/0 > Warning: Divide by zero. > ans =3D > NaN + Infi >=20 > Which should it be? >=20 > -- > Andy Adler 1(613)562-5800x6218 >=20 >=20 >=20 >=20 > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. >=20 > 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 > ------------------------------------------------------------- >=20 >=20 >=20 >=20 ------------------------------------------------------------- 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 -------------------------------------------------------------