octave-maintainers
[Top][All Lists]
Advanced

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

Re: Preserving signbit for range operator


From: Daniel J Sebald
Subject: Re: Preserving signbit for range operator
Date: Mon, 25 Feb 2013 14:37:50 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 02/25/2013 02:17 PM, Michael D. Godfrey wrote:
On 02/25/2013 03:03 PM, Daniel J Sebald wrote:
[-3:-0] -> [-3 -2 -1 0]
[-0:3] -> [-0 1 2 3]
This is at least "controversial." Sorts treat -0 and 0 as equal, but
they have to be recognized as different for various purposes such
as getting the directions right for functions of complex variables.

The complex number field is not an ordered field.  What does direction mean?


So, it seems clear to me that the "right" result for the first line
above is: [-3:-0] -> [-3 -2 -1 -0].

I cannot think of an argument for not doing this.

Well, the definition of range needs to be tweaked then. To me the current definition reads something analogous to [a:z:b] translates to

a a+1z a+2z ... a+Lz

where L is the largest integer for which a+Lz <= b. However, technically that is not correct. It is not the maximum, necessarily, but "maximum or minimum (whichever is pertinent based upon the order of the limits a and b)". Consider:

octave:6> [0:-3:-5]
ans =

   0  -3

No matter the choice, the description for the range could use some mathematical accuracy.

Dan

PS: A bit arbitrary, but this result



reply via email to

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