This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/Integer.schelp is in supercollider-common 1:3.8.0~repack-2.

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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
class:: Integer
summary:: Integer number
categories:: Math

description::
A 32 bit integer. Integer inherits most of its behaviour from its superclass.

note::
A 32 bit signed integer can represent values in the range -2147483648 to 2147483647. Adding up further returns in a wrapped result, so that and 2147483647+1= -2147483648. For a larger range, one can use link::Classes/Float::, which is 64 bit and supports many (but not all) numerical methods that int does.
::


instancemethods::

subsection:: Iteration

method:: do
Executes strong::function:: for all integers from zero to this minus one.
argument:: function
a link::Classes/Function:: which is passed two arguments, both of which are the same
integer from zero to this minus one. The reason two arguments are passed is for
symmetry with the implementations of do in link::Classes/Collection::.

method:: reverseDo
Executes strong::function:: for all integers from  this minus one to zero.

method:: for
Executes strong::function:: for all integers from this to strong::endval::, inclusive.
argument:: endval
an link::Classes/Integer::.
argument:: function
a link::Classes/Function:: which is passed two arguments, the first which is an integer from this to
endval, and the second which is a number from zero to the number of iterations minus one.

method:: forBy
Executes strong::function:: for all integers from this to strong::endval::, inclusive, stepping each time by strong::stepval::.
argument:: endval
an link::Classes/Integer::.
argument:: stepval
an link::Classes/Integer::.
argument:: function
a link::Classes/Function:: which is passed two arguments, the first which is an integer from this to
endval, and the second which is a number from zero to the number of iterations minus one.

method:: collect
Returns:: an link::Classes/Array:: of this size filled by objects generated from evaluating the strong::function::.

method:: collectAs
Returns:: a link::Classes/Collection:: of strong::class:: of this size filled by objects generated from evaluating the strong::function::.

method:: to
returns:: an link::Classes/Interval:: from this to strong::hi::.

method:: geom
returns:: an array with a geometric series of this size from start.

method:: fib
returns:: an array with a fibonacci series of this size beginning with strong::a:: and strong::b::.

method:: factors
returns:: the prime factors as array.

method:: factorial
returns:: the factorial of this.


subsection:: Random Numbers
See also: link::Guides/Randomness::

method:: xrand
argument:: exclude
an link::Classes/Integer::.
returns:: a random value from zero to this, excluding the value exclude.

method:: xrand2
argument:: exclude
an link::Classes/Integer::.
returns:: a random value from this.neg to this, excluding the value exclude.

subsection:: Conversion

method:: asAscii
returns:: a link::Classes/Char:: which has the ASCII value of the receiver.

method:: asDigit
returns:: a link::Classes/Char:: which represents the receiver as an ASCII digit.
discussion:: For example code::5.asDigit:: returns code::$5::.

method:: asBinaryDigits
returns:: an array with the binary digits (integer 0 or 1).

method:: asDigits
returns:: an array with the n-ary digits.
discussion::
See also the complementary method link::Classes/SequenceableCollection#-convertDigits::.
code::
2007.asDigits;
2007.asDigits(2);
::

method:: asBinaryString
returns:: a string with the binary digits (0 or 1).

method:: asHexString
returns:: a string with the hexadecimal digits (integer 0 to F).

method:: asIPString
returns:: a string in IP format.

method:: degreeToKey
Interpret this as index into a scale with a given number of steps per ocatve.
discussion::
code::
2.degreeToKey([0, 2, 5, 7, 11]);
::

method:: grayCode
Returns:: the gray code for the number.
discussion::
code::
2.grayCode
::

subsection:: Binary Representation

method:: setBit
set nth bit to zero (bool = false) or one (bool = true)

method::leadingZeroes
code:: { _CLZ } ::

method:: trailingZeroes
code:: { _CTZ } ::

method:: numBits
returns:: number of required bits


subsection:: Properties

method:: even
returns:: true if dividable by 2 with no rest

method:: odd
returns:: true if not dividable by 2 with no rest


subsection:: Powers Of Two

method:: nextPowerOfTwo
returns:: the next power of two greater than or equal to the receiver.
discussion::
code::
13.nextPowerOfTwo.postln;
64.nextPowerOfTwo.postln;
::

method:: isPowerOfTwo
returns:: the whether the receiver is a power of two.
discussion::
code::
13.isPowerOfTwo.postln;
64.isPowerOfTwo.postln;
::


subsection:: Prime Numbers

method:: nthPrime
returns:: the nth prime number. The receiver must be from 0 to 6541.
discussion::
code::
[0,1,2,3,4,5].collect({ arg i; i.nthPrime; }).postln;
::

method:: prevPrime
returns:: the next prime less than or equal to the receiver up to 65521.
discussion::
code::
25.prevPrime.postln;
::

method:: nextPrime
returns:: the next prime less than or equal to the receiver up to 65521.
discussion::
code::
25.nextPrime.postln;
::

method:: isPrime
returns:: whether the receiver is prime.
discussion::
code::
25.isPrime.postln;
13.isPrime.postln;
::

method:: indexOfPrime
returns:: the index of a prime number less than or equal to the receiver up to 65521.
If the receiver is not a prime, the answer is nil.
discussion::
code::
23.indexOfPrime;
25.indexOfPrime;
::


subsection:: Misc

method:: pidRunning
returns:: a Boolean for whether or not the specified pid is running.
discussion::
code::
p = "cat".unixCmd;
p.pidRunning; // cat will stay alive
("kill" + p).unixCmd
p.pidRunning;
::