[GAP Forum] Strange behaviour with Union - possible bug?

Christopher Jefferson caj21 at st-andrews.ac.uk
Fri Dec 5 22:35:14 GMT 2014


Hi Matt,

There is indeed a bug in GAP, to do with downward running ranges. I
believe this can be fixed by adding the following lines to the start of
the 'JoinRanges' method (which is at line 2538 of file lib/coll.gi on my
machine), but not this fix is not completely tested yet.

# Make ranges run upwards
  if da < 0 then
  x:=a1;a1:=a0;a0:=x;da:=-da;
  fi;
  
  if db < 0 then
  x:=b1;b1:=b0;b0:=x;db:=-db;
  fi;



I am currently testing this fix carefully, and making sure there are no
similar bugs.

Chris


On 05/12/2014 21:58, "Matt Fayers" <m.fayers at qmul.ac.uk> wrote:

>Dear GAP forum,
>
>I am experiencing some strange behaviour with GAP's Union function: the
>command
>
>Union([2],[3],[5,1..1]);
>
>returns
>
>[2,3]
>
>rather than the expected [1,2,3,5].  (If I do
>
>Union([2],[3],[5,1])
>
>or
>
>Union([2],[5,1..1])
>
>the behaviour is as expected.)
>
>Any ideas?  I'm running GAP 4.7.5 on Linux (because that's the version
>that comes with my Linux distribution); I apologise if this has already
>been resolved in a more recent version.
>
>Best wishes,
>Matt Fayers.
>____________________________________________________________________
>
>Matthew Fayers
>School of Mathematical Sciences
>Queen Mary University of London
>Mile End Road
>London
>E1 4NS
>020 7882 5479
>www.maths.qmul.ac.uk.~mf/
>____________________________________________________________________
>
>_______________________________________________
>Forum mailing list
>Forum at mail.gap-system.org
>http://mail.gap-system.org/mailman/listinfo/forum




More information about the Forum mailing list