[GAP Forum] Comparing real numbers

Joey Iverson jiverson at math.umd.edu
Mon Aug 21 15:47:24 BST 2017


Dear GAP forum,

I was recently caught off guard by the following:

gap> Sqrt(2)<2;
false

Now that I've read the manual more carefully, I don't think this is a
malfunction. Instead, it looks like GAP will always report irrational
cyclotomics to be larger than rationals.

Does anybody know of a workaround that compares real numbers with their
usual ordering instead? Suppose we agree that E(n) = exp(2*pi*i/n).

As a last resort, I suppose I could run GAP inside of SAGE and get
numerical approximations of everything, but I would like to avoid that if
possible.


Thanks for any advice!

Joey Iverson
Research Associate
University of Maryland, College Park


More information about the Forum mailing list