[GAP Forum] Comparing real numbers

Marek Mitros marek at mitros.org
Wed Sep 19 14:26:28 BST 2012


Hi,

I wonder how I could compare real numbers in GAP i.e. cyclotomics
which are real. I try Float but it doesn't work for cyclotomics - any
advice ? Say my numbers are limited to CF(5) field. Here is example:
sigma:=(E(5)+E(5)^4)/2; # = RealPart(E(5)) = (Sqrt(5)-1)/4 = 0.309...
 is real number. How I can compare whether it is bigger or smaller
that 1/2 ? It is known that this number is equal to Another real
number in CF(5) is
tau:=-RealPart(E(5)^2); # =-(E(5)^2+E(5)^3)/2=(Sqrt(5)+1)/4 = 0.809...=sigma+1/2

How could I develop function comparing elements of the field generated
by sigma and tau ? I mean comparison as real numbers. I can obtain
coefficients for given number x:
Coefficients(Basis(Field(sigma)), x)
Using this can I find the position of the number on real axis ? I.e.
compare with another field element or rational number ?

I would really be nice to have possibility of comparing real subset of
cyclotomics are real numbers in GAP.

Regards,
Marek



More information about the Forum mailing list