Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bug in 64Bit SetCyclotomicsLimit #3390

Merged
merged 1 commit into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/ref/cyclotom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ This can be raised (although not lowered) using
<Ref Func="SetCyclotomicsLimit"/> and
accessed using <Ref Func="GetCyclotomicsLimit"/>.
The maximum value of the limit is <M>2^{28}-1</M> on <M>32</M> bit systems,
and <M>2^{32}</M> on <M>64</M> bit systems.
and <M>2^{32}-1</M> on <M>64</M> bit systems.
So the maximal cyclotomic field implemented in &GAP; is not really
the field <M>&QQ;^{ab}</M>.
<P/>
Expand Down
2 changes: 1 addition & 1 deletion src/cyclotom.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ static Obj FuncSetCyclotomicsLimit(Obj self, Obj newlimit)
CyclotomicsLimit, 0);
}
#ifdef SYS_IS_64_BIT
if (ulimit > (1L << 32)) {
if (ulimit >= (1L << 32)) {
fingolfin marked this conversation as resolved.
Show resolved Hide resolved
ErrorMayQuit("Cyclotomic field size limit must be less than 2^32", 0,
0);
}
Expand Down
4 changes: 4 additions & 0 deletions tst/testinstall/cyclotom.tst
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ he integer 0)
gap> SetCyclotomicsLimit(100);
Error, SetCyclotomicsLimit: <newlimit> must not be less than old limit of 1000\
000
#@if 8*GAPInfo.BytesPerVariable = 64
gap> SetCyclotomicsLimit(2^32);
Error, Cyclotomic field size limit must be less than 2^32
fingolfin marked this conversation as resolved.
Show resolved Hide resolved
#@fi
gap> SetCyclotomicsLimit(1000000);

#
Expand Down