bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] ⍋ on complex data


From: Louis de Forcrand
Subject: Re: [Bug-apl] ⍋ on complex data
Date: Sat, 5 Mar 2016 15:50:12 +0100

Hmm. In J they are sorted first by real part, then by imaginary part.

Louis

On 05 Mar 2016, at 15:46, Elias Mårtenson <address@hidden> wrote:

On 5 March 2016 at 20:12, Alexey Veretennikov <address@hidden> wrote:

Complex numbers are incomparable in mathematical sense. In Dyalog APL
this leads to DOMAIN ERROR however.

This is the intended behaviour in GNU APL as well. This can be seen in the function Bif_F12_SORT::sort():

    loop(bz, len_BZ)
       {
         array[bz] = &B->get_ravel(bz*comp_len);
         if (array[bz]->is_complex_cell())
            return Token(TOK_ERROR, E_DOMAIN_ERROR);
       }

I believe the problem is that this function returns a Token instead of directly raising DOMAIN ERROR.

Regards,
Elias


reply via email to

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