Bill Allombert on Tue, 15 Sep 2026 12:55:00 +0200


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

Re: vecmax issue


On Tue, Sep 15, 2026 at 12:37:06PM +0200, Ruud H.G. van Tol wrote:
> 
> ? version()
> %1 = [2, 17, 4]
> 
> ? vecmax([[0], [1]])
>   ***   at top-level: vecmax([[0],[1]])
>   ***                 ^-----------------
>   *** vecmax: forbidden comparison t_VEC (1 elts) , t_VEC (1 elts).
>   ***   Break loop: type 'break' to go back to GP prompt
> break>
> 
> Is that as expected?

Yes.

> ? vecsort([[0], [1]],,4)[1]
> %2 = [1]

??vecmax
 'largest refers to the ordinary real ordering ( <= )'

??vecsort
 'If  cmpf  is  omitted,   we  use  the standard comparison function lex'

This is not the same ordering.

Cheers,
Bill.