Bill Allombert on Sat, 24 Feb 2018 21:16:09 +0100


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

Re: forpart() behavior


On Sat, Feb 24, 2018 at 12:06:39PM -0500, Max Alekseyev wrote:
> Hello!
> 
> In PARI/GP version Version 2.10.0 (development 21603-bef585b) I observe:
> 
> ===
> ? forpart(p=1,print(p),[0,5],3)
> Vecsmall([0, 0, 1])
> ? forpart(p=0,print(p),[0,5],3)
> ? forpart(p=1,print(p),[0,5],[3,4])
> Vecsmall([0, 1, 1, -1])
> ===
> 
> I believe "forpart(p=0,print(p),[0,5],3)" should produce "Vecsmall([0, 0, 0])",
> and "forpart(p=1,print(p),[0,5],[3,4])" should produce "Vecsmall([0,
> 0, 1])" and "Vecsmall([0, 0, 0, 1])".
> 
> What's wrong?

It is a bug I introduced a long time ago in commit 941833e2

Older version give correctly:
? partitions(1,[0,5],[3,4])
%3 = [Vecsmall([0,0,0,1])]

Thanks for spotting this!
Bill.