rsc3/doc-schelp/Help-3.12.2/Classes/Integer.html

314 lines
No EOL
30 KiB
HTML

<!doctype html><html lang='en'><head><title>Integer | SuperCollider 3.9.3 Help</title>
<link rel='stylesheet' href='./../scdoc.css' type='text/css' />
<link rel='stylesheet' href='./../frontend.css' type='text/css' />
<link rel='stylesheet' href='./../custom.css' type='text/css' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<script>
var helpRoot = './..';
var scdoc_title = 'Integer';
var scdoc_sc_version = '3.9.3';
</script>
<script src='./../scdoc.js' type='text/javascript'></script>
<script src='./../docmap.js' type='text/javascript'></script>
<script src='./../prettify.js' type='text/javascript'></script>
<script src='./../lang-sc.js' type='text/javascript'></script>
</head>
<body onload='fixTOC();prettyPrint()'>
<div id='toc'>
<div id='toctitle'>Integer:</div>
<span class='toc_search'>Filter: <input id='toc_search'></span><ul class='toc'><li class='toc1'><a href='#description'>Description</a></li>
<ul class='toc'></ul><li class='toc1'><a href='#classmethods'>Class methods</a></li>
<ul class='toc'><li class='toc2'><a href='#Inherited%20class%20methods'>Inherited class methods</a></li>
</ul><li class='toc1'><a href='#instancemethods'>Instance methods</a></li>
<ul class='toc'><li class='toc2'><a href='#Iteration'>Iteration</a></li>
<ul class='toc'><li class='toc3'><a href='#-do'>do</a> </li>
<li class='toc3'><a href='#-reverseDo'>reverseDo</a> </li>
<li class='toc3'><a href='#-for'>for</a> </li>
<li class='toc3'><a href='#-forBy'>forBy</a> </li>
<li class='toc3'><a href='#-collect'>collect</a> </li>
<li class='toc3'><a href='#-collectAs'>collectAs</a> </li>
<li class='toc3'><a href='#-to'>to</a> </li>
<li class='toc3'><a href='#-geom'>geom</a> </li>
<li class='toc3'><a href='#-fib'>fib</a> </li>
<li class='toc3'><a href='#-factors'>factors</a> </li>
<li class='toc3'><a href='#-factorial'>factorial</a> </li>
</ul><li class='toc2'><a href='#Random%20Numbers'>Random Numbers</a></li>
<ul class='toc'><li class='toc3'><a href='#-xrand'>xrand</a> </li>
<li class='toc3'><a href='#-xrand2'>xrand2</a> </li>
</ul><li class='toc2'><a href='#Conversion'>Conversion</a></li>
<ul class='toc'><li class='toc3'><a href='#-asAscii'>asAscii</a> </li>
<li class='toc3'><a href='#-asDigit'>asDigit</a> </li>
<li class='toc3'><a href='#-asBinaryDigits'>asBinaryDigits</a> </li>
<li class='toc3'><a href='#-asDigits'>asDigits</a> </li>
<li class='toc3'><a href='#-asBinaryString'>asBinaryString</a> </li>
<li class='toc3'><a href='#-asHexString'>asHexString</a> </li>
<li class='toc3'><a href='#-asIPString'>asIPString</a> </li>
<li class='toc3'><a href='#-degreeToKey'>degreeToKey</a> </li>
<li class='toc3'><a href='#-grayCode'>grayCode</a> </li>
</ul><li class='toc2'><a href='#Binary%20Representation'>Binary Representation</a></li>
<ul class='toc'><li class='toc3'><a href='#-setBit'>setBit</a> </li>
<li class='toc3'><a href='#-leadingZeroes'>leadingZeroes</a> </li>
<li class='toc3'><a href='#-trailingZeroes'>trailingZeroes</a> </li>
<li class='toc3'><a href='#-numBits'>numBits</a> </li>
</ul><li class='toc2'><a href='#Properties'>Properties</a></li>
<ul class='toc'><li class='toc3'><a href='#-even'>even</a> </li>
<li class='toc3'><a href='#-odd'>odd</a> </li>
</ul><li class='toc2'><a href='#Powers%20Of%20Two'>Powers Of Two</a></li>
<ul class='toc'><li class='toc3'><a href='#-nextPowerOfTwo'>nextPowerOfTwo</a> </li>
<li class='toc3'><a href='#-isPowerOfTwo'>isPowerOfTwo</a> </li>
</ul><li class='toc2'><a href='#Prime%20Numbers'>Prime Numbers</a></li>
<ul class='toc'><li class='toc3'><a href='#-nthPrime'>nthPrime</a> </li>
<li class='toc3'><a href='#-prevPrime'>prevPrime</a> </li>
<li class='toc3'><a href='#-nextPrime'>nextPrime</a> </li>
<li class='toc3'><a href='#-isPrime'>isPrime</a> </li>
<li class='toc3'><a href='#-indexOfPrime'>indexOfPrime</a> </li>
</ul><li class='toc2'><a href='#Misc'>Misc</a></li>
<ul class='toc'><li class='toc3'><a href='#-pidRunning'>pidRunning</a> </li>
</ul><li class='toc2'><a href='#Inherited%20instance%20methods'>Inherited instance methods</a></li>
<li class='toc2'><a href='#Undocumented%20instance%20methods'>Undocumented instance methods</a></li>
<ul class='toc'><li class='toc3'><a href='#-*'>*</a> </li>
<li class='toc3'><a href='#-+'>+</a> </li>
<li class='toc3'><a href='#--'>-</a> </li>
<li class='toc3'><a href='#-archiveAsCompileString'>archiveAsCompileString</a> </li>
<li class='toc3'><a href='#-asBus'>asBus</a> </li>
<li class='toc3'><a href='#-asFileSafeChar'>asFileSafeChar</a> </li>
<li class='toc3'><a href='#-asFileSafeString'>asFileSafeString</a> </li>
<li class='toc3'><a href='#-asGroup'>asGroup</a> </li>
<li class='toc3'><a href='#-asNodeID'>asNodeID</a> </li>
<li class='toc3'><a href='#-asStringToBase'>asStringToBase</a> </li>
<li class='toc3'><a href='#-asTarget'>asTarget</a> </li>
<li class='toc3'><a href='#-asUnicode'>asUnicode</a> </li>
<li class='toc3'><a href='#-clip'>clip</a> </li>
<li class='toc3'><a href='#-exit'>exit</a> </li>
<li class='toc3'><a href='#-fold'>fold</a> </li>
<li class='toc3'><a href='#-generate'>generate</a> </li>
<li class='toc3'><a href='#-hash'>hash</a> </li>
<li class='toc3'><a href='#-isAlt'>isAlt</a> </li>
<li class='toc3'><a href='#-isCaps'>isCaps</a> </li>
<li class='toc3'><a href='#-isCmd'>isCmd</a> </li>
<li class='toc3'><a href='#-isCtrl'>isCtrl</a> </li>
<li class='toc3'><a href='#-isFun'>isFun</a> </li>
<li class='toc3'><a href='#-isHelp'>isHelp</a> </li>
<li class='toc3'><a href='#-isInteger'>isInteger</a> </li>
<li class='toc3'><a href='#-isNumPad'>isNumPad</a> </li>
<li class='toc3'><a href='#-isShift'>isShift</a> </li>
<li class='toc3'><a href='#-log2Ceil'>log2Ceil</a> </li>
<li class='toc3'><a href='#-schedBundle'>schedBundle</a> </li>
<li class='toc3'><a href='#-wrap'>wrap</a> </li>
</ul></ul></ul></div><div class='contents'>
<div id='menubar'></div>
<div class='header'>
<div id='label'>
<span id='folder'>Classes</span>
| <span id='categories'><a href='./../Browse.html#Math'>Math</a></span>
</div><h1>Integer<span id='superclasses'> : <a href="../Classes/SimpleNumber.html">SimpleNumber</a> : <a href="../Classes/Number.html">Number</a> : <a href="../Classes/Magnitude.html">Magnitude</a> : <a href="../Classes/Object.html">Object</a></span>
</h1>
<div id='summary'>Integer number</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Math/Integer.sc' title='/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Math/Integer.sc'>Integer.sc</a></div></div>
<h2><a class='anchor' name='description'>Description</a></h2>
<p>A 32 bit integer. Integer inherits most of its behaviour from its superclass.<div class='note'><span class='notelabel'>NOTE:</span> 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 <a href="./../Classes/Float.html">Float</a>, which is 64 bit and supports many (but not all) numerical methods that int does.</div><h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3><a class='anchor' name='Inherited%20class%20methods'>Inherited class methods</a></h3>
<div id='inheritedclassmets'></div><h2><a class='anchor' name='instancemethods'>Instance Methods</a></h2>
<h3><a class='anchor' name='Iteration'>Iteration</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-do' href='./../Overviews/Methods.html#do'>do</a>(<span class='argstr'>function</span>)</h3>
<div class='method'>
<p>Executes <strong>function</strong> for all integers from zero to this minus one.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>function<td class='argumentdesc'>
<p>a <a href="./../Classes/Function.html">Function</a> 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 <a href="./../Classes/Collection.html">Collection</a>.</table></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-reverseDo' href='./../Overviews/Methods.html#reverseDo'>reverseDo</a>(<span class='argstr'>function</span>)</h3>
<div class='method'>
<p>Executes <strong>function</strong> for all integers from this minus one to zero.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-for' href='./../Overviews/Methods.html#for'>for</a>(<span class='argstr'>endval</span>, <span class='argstr'>function</span>)</h3>
<div class='method'>
<p>Executes <strong>function</strong> for all integers from this to <strong>endval</strong>, inclusive.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>endval<td class='argumentdesc'>
<p>an <a href="./../Classes/Integer.html">Integer</a>.<tr><td class='argumentname'>function<td class='argumentdesc'>
<p>a <a href="./../Classes/Function.html">Function</a> 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.</table></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-forBy' href='./../Overviews/Methods.html#forBy'>forBy</a>(<span class='argstr'>endval</span>, <span class='argstr'>stepval</span>, <span class='argstr'>function</span>)</h3>
<div class='method'>
<p>Executes <strong>function</strong> for all integers from this to <strong>endval</strong>, inclusive, stepping each time by <strong>stepval</strong>.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>endval<td class='argumentdesc'>
<p>an <a href="./../Classes/Integer.html">Integer</a>.<tr><td class='argumentname'>stepval<td class='argumentdesc'>
<p>an <a href="./../Classes/Integer.html">Integer</a>.<tr><td class='argumentname'>function<td class='argumentdesc'>
<p>a <a href="./../Classes/Function.html">Function</a> 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.</table></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-collect' href='./../Overviews/Methods.html#collect'>collect</a>(<span class='argstr'>function</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>an <a href="./../Classes/Array.html">Array</a> of this size filled by objects generated from evaluating the <strong>function</strong>.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-collectAs' href='./../Overviews/Methods.html#collectAs'>collectAs</a>(<span class='argstr'>function</span>, <span class='argstr'>class</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>a <a href="./../Classes/Collection.html">Collection</a> of <strong>class</strong> of this size filled by objects generated from evaluating the <strong>function</strong>.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-to' href='./../Overviews/Methods.html#to'>to</a>(<span class='argstr'>hi</span>, <span class='argstr'>step: 1</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>an <a href="./../Classes/Interval.html">Interval</a> from this to <strong>hi</strong>.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-geom' href='./../Overviews/Methods.html#geom'>geom</a>(<span class='argstr'>start</span>, <span class='argstr'>grow</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>an array with a geometric series of this size from start.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-fib' href='./../Overviews/Methods.html#fib'>fib</a>(<span class='argstr'>a: 0</span>, <span class='argstr'>b: 1</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>an array with a fibonacci series of this size beginning with <strong>a</strong> and <strong>b</strong>.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-factors' href='./../Overviews/Methods.html#factors'>factors</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>the prime factors as array.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-factorial' href='./../Overviews/Methods.html#factorial'>factorial</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>the factorial of this.</div></div><h3><a class='anchor' name='Random%20Numbers'>Random Numbers</a></h3>
<p>See also: <a href="./../Guides/Randomness.html">Randomness</a><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-xrand' href='./../Overviews/Methods.html#xrand'>xrand</a>(<span class='argstr'>exclude: 0</span>)</h3>
<div class='method'><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>exclude<td class='argumentdesc'>
<p>an <a href="./../Classes/Integer.html">Integer</a>.</table><h4>Returns:</h4>
<div class='returnvalue'>
<p>a random value from zero to this, excluding the value exclude.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-xrand2' href='./../Overviews/Methods.html#xrand2'>xrand2</a>(<span class='argstr'>exclude: 0</span>)</h3>
<div class='method'><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>exclude<td class='argumentdesc'>
<p>an <a href="./../Classes/Integer.html">Integer</a>.</table><h4>Returns:</h4>
<div class='returnvalue'>
<p>a random value from this.neg to this, excluding the value exclude.</div></div><h3><a class='anchor' name='Conversion'>Conversion</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asAscii' href='./../Overviews/Methods.html#asAscii'>asAscii</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>a <a href="./../Classes/Char.html">Char</a> which has the ASCII value of the receiver.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asDigit' href='./../Overviews/Methods.html#asDigit'>asDigit</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>a <a href="./../Classes/Char.html">Char</a> which represents the receiver as an ASCII digit.</div><h4>Discussion:</h4>
<p>For example <code class='code prettyprint lang-sc'>5.asDigit</code> returns <code class='code prettyprint lang-sc'>$5</code>.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asBinaryDigits' href='./../Overviews/Methods.html#asBinaryDigits'>asBinaryDigits</a>(<span class='argstr'>numDigits: 8</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>an array with the binary digits (integer 0 or 1).</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asDigits' href='./../Overviews/Methods.html#asDigits'>asDigits</a>(<span class='argstr'>base: 10</span>, <span class='argstr'>numDigits</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>an array with the n-ary digits.</div><h4>Discussion:</h4>
<p>See also the complementary method <a href="./../Classes/SequenceableCollection.html#-convertDigits">SequenceableCollection: -convertDigits</a>.<pre class='code prettyprint lang-sc'>2007.asDigits;
2007.asDigits(2);</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asBinaryString' href='./../Overviews/Methods.html#asBinaryString'>asBinaryString</a>(<span class='argstr'>width: 8</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>a string with the binary digits (0 or 1).</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asHexString' href='./../Overviews/Methods.html#asHexString'>asHexString</a>(<span class='argstr'>width: 8</span>)</h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>a string with the hexadecimal digits (integer 0 to F).</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asIPString' href='./../Overviews/Methods.html#asIPString'>asIPString</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>a string in IP format.</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-degreeToKey' href='./../Overviews/Methods.html#degreeToKey'>degreeToKey</a>(<span class='argstr'>scale</span>, <span class='argstr'>stepsPerOctave: 12</span>)</h3>
<div class='method'>
<p>Interpret this as index into a scale with a given number of steps per ocatve.<h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>2.degreeToKey([0, 2, 5, 7, 11]);</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-grayCode' href='./../Overviews/Methods.html#grayCode'>grayCode</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>the gray code for the number.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>2.grayCode</pre>
</div><h3><a class='anchor' name='Binary%20Representation'>Binary Representation</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-setBit' href='./../Overviews/Methods.html#setBit'>setBit</a>(<span class='argstr'>bitNumber</span>, <span class='argstr'>bool: true</span>)</h3>
<div class='method'>
<p>set nth bit to zero (bool = false) or one (bool = true)</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-leadingZeroes' href='./../Overviews/Methods.html#leadingZeroes'>leadingZeroes</a></h3>
<div class='method'>
<p><code class='code prettyprint lang-sc'>{ _CLZ }</code></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-trailingZeroes' href='./../Overviews/Methods.html#trailingZeroes'>trailingZeroes</a></h3>
<div class='method'>
<p><code class='code prettyprint lang-sc'>{ _CTZ }</code></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-numBits' href='./../Overviews/Methods.html#numBits'>numBits</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>number of required bits</div></div><h3><a class='anchor' name='Properties'>Properties</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-even' href='./../Overviews/Methods.html#even'>even</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>true if dividable by 2 with no rest</div></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-odd' href='./../Overviews/Methods.html#odd'>odd</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>true if not dividable by 2 with no rest</div></div><h3><a class='anchor' name='Powers%20Of%20Two'>Powers Of Two</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-nextPowerOfTwo' href='./../Overviews/Methods.html#nextPowerOfTwo'>nextPowerOfTwo</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>the next power of two greater than or equal to the receiver.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>13.nextPowerOfTwo.postln;
64.nextPowerOfTwo.postln;</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isPowerOfTwo' href='./../Overviews/Methods.html#isPowerOfTwo'>isPowerOfTwo</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>the whether the receiver is a power of two.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>13.isPowerOfTwo.postln;
64.isPowerOfTwo.postln;</pre>
</div><h3><a class='anchor' name='Prime%20Numbers'>Prime Numbers</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-nthPrime' href='./../Overviews/Methods.html#nthPrime'>nthPrime</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>the nth prime number. The receiver must be from 0 to 6541.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>[0,1,2,3,4,5].collect({ arg i; i.nthPrime; }).postln;</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-prevPrime' href='./../Overviews/Methods.html#prevPrime'>prevPrime</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>the next prime less than or equal to the receiver up to 65521.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>25.prevPrime.postln;</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-nextPrime' href='./../Overviews/Methods.html#nextPrime'>nextPrime</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>the next prime less than or equal to the receiver up to 65521.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>25.nextPrime.postln;</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isPrime' href='./../Overviews/Methods.html#isPrime'>isPrime</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>whether the receiver is prime.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>25.isPrime.postln;
13.isPrime.postln;</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-indexOfPrime' href='./../Overviews/Methods.html#indexOfPrime'>indexOfPrime</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>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.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>23.indexOfPrime;
25.indexOfPrime;</pre>
</div><h3><a class='anchor' name='Misc'>Misc</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-pidRunning' href='./../Overviews/Methods.html#pidRunning'>pidRunning</a></h3>
<div class='method'><h4>Returns:</h4>
<div class='returnvalue'>
<p>a Boolean for whether or not the specified pid is running.</div><h4>Discussion:</h4>
<pre class='code prettyprint lang-sc'>p = "cat".unixCmd;
p.pidRunning; // cat will stay alive
("kill" + p).unixCmd
p.pidRunning;</pre>
<p></div><h3><a class='anchor' name='Inherited%20instance%20methods'>Inherited instance methods</a></h3>
<div id='inheritedinstmets'></div><h3><a class='anchor' name='Undocumented%20instance%20methods'>Undocumented instance methods</a></h3>
<h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='-*' href='./../Overviews/Methods.html#*'>*</a>(<span class='argstr'>aNumber</span>, <span class='argstr'>adverb</span>)</h3>
<h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='-+' href='./../Overviews/Methods.html#+'>+</a>(<span class='argstr'>aNumber</span>, <span class='argstr'>adverb</span>)</h3>
<h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='--' href='./../Overviews/Methods.html#-'>-</a>(<span class='argstr'>aNumber</span>, <span class='argstr'>adverb</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-archiveAsCompileString' href='./../Overviews/Methods.html#archiveAsCompileString'>archiveAsCompileString</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asBus' href='./../Overviews/Methods.html#asBus'>asBus</a>(<span class='argstr'>rate: 'control'</span>, <span class='argstr'>numChannels: 1</span>, <span class='argstr'>server</span>)</h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asBus.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asBus.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asFileSafeChar' href='./../Overviews/Methods.html#asFileSafeChar'>asFileSafeChar</a></h3>
<div class='extmethod'>From extension in <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asFileSafeString' href='./../Overviews/Methods.html#asFileSafeString'>asFileSafeString</a></h3>
<div class='extmethod'>From extension in <a href='file:///Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc'>/Users/zzk/Library/Application Support/SuperCollider/downloaded-quarks/crucial-library/Players/pathUtilities.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asGroup' href='./../Overviews/Methods.html#asGroup'>asGroup</a></h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asGroup.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asGroup.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asNodeID' href='./../Overviews/Methods.html#asNodeID'>asNodeID</a></h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asTarget.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asTarget.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asStringToBase' href='./../Overviews/Methods.html#asStringToBase'>asStringToBase</a>(<span class='argstr'>base: 10</span>, <span class='argstr'>width: 8</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asTarget' href='./../Overviews/Methods.html#asTarget'>asTarget</a></h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asTarget.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asTarget.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asUnicode' href='./../Overviews/Methods.html#asUnicode'>asUnicode</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-clip' href='./../Overviews/Methods.html#clip'>clip</a>(<span class='argstr'>lo</span>, <span class='argstr'>hi</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-exit' href='./../Overviews/Methods.html#exit'>exit</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-fold' href='./../Overviews/Methods.html#fold'>fold</a>(<span class='argstr'>lo</span>, <span class='argstr'>hi</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-generate' href='./../Overviews/Methods.html#generate'>generate</a>(<span class='argstr'>function</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-hash' href='./../Overviews/Methods.html#hash'>hash</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isAlt' href='./../Overviews/Methods.html#isAlt'>isAlt</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isCaps' href='./../Overviews/Methods.html#isCaps'>isCaps</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isCmd' href='./../Overviews/Methods.html#isCmd'>isCmd</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isCtrl' href='./../Overviews/Methods.html#isCtrl'>isCtrl</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isFun' href='./../Overviews/Methods.html#isFun'>isFun</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isHelp' href='./../Overviews/Methods.html#isHelp'>isHelp</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isInteger' href='./../Overviews/Methods.html#isInteger'>isInteger</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isNumPad' href='./../Overviews/Methods.html#isNumPad'>isNumPad</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isShift' href='./../Overviews/Methods.html#isShift'>isShift</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-log2Ceil' href='./../Overviews/Methods.html#log2Ceil'>log2Ceil</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-schedBundle' href='./../Overviews/Methods.html#schedBundle'>schedBundle</a>(<span class='argstr'>bundle</span>, <span class='argstr'>server</span>, <span class='argstr'>timeOfRequest</span>)</h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/schedBundle.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/schedBundle.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-wrap' href='./../Overviews/Methods.html#wrap'>wrap</a>(<span class='argstr'>lo</span>, <span class='argstr'>hi</span>)</h3>
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/Integer.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/Integer.schelp</a><br>link::Classes/Integer::<br></div></div></body></html>