This file is indexed.

/usr/share/gap/doc/ref/chap17.txt is in gap-online-help 4r6p5-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
  
  17 Rational Numbers
  
  The  rationals  form  a  very  important  field.  On  the one hand it is the
  quotient field of the integers (see chapter 14). On the other hand it is the
  prime field of the fields of characteristic zero (see chapter 60).
  
  The  former comment suggests the representation actually used. A rational is
  represented  as  a  pair  of  integers,  called  numerator  and denominator.
  Numerator  and  denominator are reduced, i.e., their greatest common divisor
  is  1.  If  the  denominator is 1, the rational is in fact an integer and is
  represented  as such. The numerator holds the sign of the rational, thus the
  denominator is always positive.
  
  Because  the  underlying  integer arithmetic can compute with arbitrary size
  integers,  the rational arithmetic is always exact, even for rationals whose
  numerators and denominators have thousands of digits.
  
    Example  
    gap> 2/3;
    2/3
    gap> 66/123;  # numerator and denominator are made relatively prime
    22/41
    gap> 17/-13;  # the numerator carries the sign;
    -17/13
    gap> 121/11;  # rationals with denominator 1 (when canceled) are integers
    11
  
  
  
  17.1 Rationals: Global Variables
  
  17.1-1 Rationals
  
  Rationals global variable
  IsRationals( obj )  property
  
  Rationals  is  the  field  â„š  of  rational  integers, as a set of cyclotomic
  numbers,  see  Chapter 18  for  basic  operations,  Functions  for the field
  Rationals can be found in the chapters 58 and 60.
  
  IsRationals  returns  true  for  a  prime  field that consists of cyclotomic
  numbers  –for  example the GAP object Rationals– and false for all other GAP
  objects.
  
    Example  
    gap> Size( Rationals ); 2/3 in Rationals;
    infinity
    true
  
  
  
  17.2 Elementary Operations for Rationals
  
  17.2-1 IsRat
  
  IsRat( obj )  Category
  
  Every  rational number lies in the category IsRat, which is a subcategory of
  IsCyc (18.1-3).
  
    Example  
    gap> IsRat( 2/3 );
    true
    gap> IsRat( 17/-13 );
    true
    gap> IsRat( 11 );
    true
    gap> IsRat( IsRat );  # `IsRat' is a function, not a rational
    false
  
  
  17.2-2 IsPosRat
  
  IsPosRat( obj )  Category
  
  Every positive rational number lies in the category IsPosRat.
  
  17.2-3 IsNegRat
  
  IsNegRat( obj )  Category
  
  Every negative rational number lies in the category IsNegRat.
  
  17.2-4 NumeratorRat
  
  NumeratorRat( rat )  function
  
  NumeratorRat  returns  the  numerator  of  the  rational  rat.  Because  the
  numerator holds the sign of the rational it may be any integer. Integers are
  rationals with denominator 1, thus NumeratorRat is the identity function for
  integers.
  
    Example  
    gap> NumeratorRat( 2/3 );
    2
    gap> # numerator and denominator are made relatively prime:
    gap> NumeratorRat( 66/123 );
    22
    gap> NumeratorRat( 17/-13 );  # numerator holds the sign of the rational
    -17
    gap> NumeratorRat( 11 );      # integers are rationals with denominator 1
    11
  
  
  17.2-5 DenominatorRat
  
  DenominatorRat( rat )  function
  
  DenominatorRat  returns  the  denominator  of  the rational rat. Because the
  numerator  holds  the  sign  of  the  rational  the  denominator is always a
  positive  integer.  Integers  are  rationals  with  the  denominator 1, thus
  DenominatorRat returns 1 for integers.
  
    Example  
    gap> DenominatorRat( 2/3 );
    3
    gap> # numerator and denominator are made relatively prime:
    gap> DenominatorRat( 66/123 );
    41
    gap> # the denominator holds the sign of the rational:
    gap> DenominatorRat( 17/-13 );
    13
    gap> DenominatorRat( 11 ); # integers are rationals with denominator 1
    1
  
  
  17.2-6 Rat
  
  Rat( elm )  attribute
  
  Rat returns a rational number rat whose meaning depends on the type of elm.
  
  If  elm  is a string consisting of digits '0', '1', ..., '9' and '-' (at the
  first  position),  '/'  and  the  decimal  dot  '.' then rat is the rational
  described  by  this  string.  The  operation  String (27.6-6) can be used to
  compute a string for rational numbers, in fact for all cyclotomics.
  
    Example  
    gap> Rat( "1/2" );  Rat( "35/14" );  Rat( "35/-27" );  Rat( "3.14159" );
    1/2
    5/2
    -35/27
    314159/100000
  
  
  17.2-7 Random
  
  Random( Rationals )  operation
  
  Random  for rationals returns pseudo random rationals which are the quotient
  of two random integers. See the description of Random (14.2-12) for details.
  (Also see Random (30.7-1).)