octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sqrtm test failure


From: Marco atzeri
Subject: Re: sqrtm test failure
Date: Sat, 30 Jul 2011 12:37:56 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0

On 7/29/2011 11:06 PM, John W. Eaton wrote:
On 29-Jul-2011, Marco atzeri wrote:

| on src/DLD-FUNCTIONS/sqrtm.cc
| the following test is failing
|
| %!assert (isnan (sqrtm ([0 1; 0 0])))
|
| but it is not clear to me, what is the expected results
| as isnan applied to a matrix produces a matrix

The assert will succeed only if all elements of the matrix returned by
isnan are true.

|>  sqrtm ([0 1; 0 0])
| warning: sqrtm: matrix is singular, may not have a square root
| ans =
|
|       0   NaN
|       0   NaN
|
|
|>  isnan(sqrtm ([0 1; 0 0]))
| warning: sqrtm: matrix is singular, may not have a square root
| ans =
|
|     0   1
|     0   1

On my system, I see

   octave>  sqrtm ([0,1; 0, 0])
   warning: sqrtm: matrix is singular, may not have a square root
   ans =

      NaN - NaNi   NaN - NaNi
      NaN - NaNi   NaN - NaNi

I'm not sure why this result should be complex.

jwe

probably to avoid that the real or img of NaN is wrongly reported as
a number.

I will add this to my list of tests that fails on
cygwin for different NaN implementation.

Regards
Marco



reply via email to

[Prev in Thread] Current Thread [Next in Thread]