[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #31974] Interpreter fails to create complex nu
From: |
Judd Storrs |
Subject: |
[Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts |
Date: |
Wed, 05 Jan 2011 20:05:18 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Ubuntu/10.04 Chromium/8.0.552.224 Chrome/8.0.552.224 Safari/534.10 |
Follow-up Comment #23, bug #31974 (project octave):
After I tested this in an old Matlab version (R2007b), I realized that R2007b
doesn't behave the way R2010a is reported to below:
R2007b>> x = Inf;
R2007b>> x * j
ans = NaN + Infi
But below it is claimed
R2010a>> x = Inf;
R2010a>> x * j
ans = 0 + Infi
So, Matlab seems to have changed since the version I have access to.
FWIW this is what I see in the old Matlab version:
$ matlab -nojvm
< M A T L A B >
Copyright 1984-2007 The MathWorks, Inc.
Version 7.5.0.338 (R2007b)
August 9, 2007
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
>> foo(i)
real part is allocated; its value is 0
imaginary part is allocated, its value is 1
>> foo(1)
real part is allocated; its value is 1
>> foo(complex(1,0))
real part is allocated; its value is 1
imaginary part is allocated, its value is 0
So, after mxGetPr is called, the real part exists. It may of course be that
Matlab creates that field on demand either before mxGetPr() or before handing
off any value to MEX.
As for the rest, this is what I see in R2007b, but I doubt it is helpful
because of the difference I noted above.
>> x = 1+i
x = 1.0000 + 1.0000i
>> y = -1+i
y = -1.0000 + 1.0000i
>> z = x+y
z = 0 + 2.0000i
>> Inf * z
ans = NaN + Infi
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?31974>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, Jaroslav Hajek, 2011/01/02
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, John W. Eaton, 2011/01/03
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, Søren Hauberg, 2011/01/03
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, Judd Storrs, 2011/01/03
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, John W. Eaton, 2011/01/05
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, John W. Eaton, 2011/01/05
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts,
Judd Storrs <=
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, John W. Eaton, 2011/01/06
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, Judd Storrs, 2011/01/06
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, John W. Eaton, 2011/01/06
- [Octave-bug-tracker] [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, John W. Eaton, 2011/01/06
[Octave-bug-tracker] Re: [bug #31974] Interpreter fails to create complex numbers with Inf complex parts, Jaroslav Hajek, 2011/01/03