octave-maintainers
[Top][All Lists]
Advanced

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

Re: Help testing max() function


From: Julien Bect
Subject: Re: Help testing max() function
Date: Thu, 25 Sep 2014 20:29:10 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

Le 25/09/2014 20:25, Rik a écrit :
During OctConf 2014 I started trying to improve the line coverage on the
file max.cc and have come across all sorts of issues.  Could someone test
the following code in Matlab to see how they order arguments with equal
magnitude, but different phase angle.  Octave should order results by phase
angle, but sometimes it doesn't.

max ([2, 2i])
max (sparse ([2, 2i])
max (2, 2i)
sort ([1 i -1 -i].', 'ascend')
sort ([1 i -1 -i]', 'ascend')

Hello Rik,

Here it is (R2012a) :

>> max ([2, 2i])

ans =

        0 + 2.0000i

>> max (sparse ([2, 2i]))

ans =

   (1,1)           0 + 2.0000i

>> max (2, 2i)

ans =

        0 + 2.0000i

>> sort ([1 i -1 -i].', 'ascend')

ans =

        0 - 1.0000i
   1.0000
        0 + 1.0000i
  -1.0000

>> sort ([1 i -1 -i]', 'ascend')

ans =

        0 - 1.0000i
   1.0000
        0 + 1.0000i
  -1.0000


@++
Julien




reply via email to

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