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

141 lines
14 KiB
HTML
Raw Normal View History

2022-08-24 13:53:18 +00:00
<!doctype html><html lang='en'><head><title>Number | 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 = 'Number';
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'>Number:</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='#Math'>Math</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='#-/'>/</a> </li>
<li class='toc3'><a href='#-div'>div</a> </li>
<li class='toc3'><a href='#-%'>%</a> </li>
<li class='toc3'><a href='#-**'>**</a> </li>
</ul><li class='toc2'><a href='#Polar%20Coordinate%20Support'>Polar Coordinate Support</a></li>
<ul class='toc'><li class='toc3'><a href='#-rho'>rho</a> </li>
<li class='toc3'><a href='#-theta'>theta</a> </li>
</ul><li class='toc2'><a href='#Complex%20Number%20Support'>Complex Number Support</a></li>
<ul class='toc'><li class='toc3'><a href='#-real'>real</a> </li>
<li class='toc3'><a href='#-imag'>imag</a> </li>
</ul><li class='toc2'><a href='#Conversion'>Conversion</a></li>
<ul class='toc'><li class='toc3'><a href='#-@'>@</a> </li>
<li class='toc3'><a href='#-complex'>complex</a> </li>
<li class='toc3'><a href='#-polar'>polar</a> </li>
</ul><li class='toc2'><a href='#Iteration'>Iteration</a></li>
<ul class='toc'><li class='toc3'><a href='#-for'>for</a> </li>
<li class='toc3'><a href='#-forBy'>forBy</a> </li>
<li class='toc3'><a href='#-forSeries'>forSeries</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='#-asLayoutElement'>asLayoutElement</a> </li>
<li class='toc3'><a href='#-half'>half</a> </li>
<li class='toc3'><a href='#-isNumber'>isNumber</a> </li>
<li class='toc3'><a href='#-mod'>mod</a> </li>
<li class='toc3'><a href='#-performBinaryOpOnPoint'>performBinaryOpOnPoint</a> </li>
<li class='toc3'><a href='#-performBinaryOpOnSeqColl'>performBinaryOpOnSeqColl</a> </li>
<li class='toc3'><a href='#-pow'>pow</a> </li>
<li class='toc3'><a href='#-twice'>twice</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>Number<span id='superclasses'> : <a href="../Classes/Magnitude.html">Magnitude</a> : <a href="../Classes/Object.html">Object</a></span>
</h1>
<div id='summary'>Mathematical quantity</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Math/Number.sc' title='/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Math/Number.sc'>Number.sc</a></div><div id='subclasses'>Subclasses: <a href="../Classes/Complex.html">Complex</a>, <a href="../Classes/Polar.html">Polar</a>, <a href="../Classes/SimpleNumber.html">SimpleNumber</a></div>
</div>
<h2><a class='anchor' name='description'>Description</a></h2>
<p>Number represents a mathematical quantity.<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='Math'>Math</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>)</h3>
<div class='method'>
<p>Addition.</div><h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='--' href='./../Overviews/Methods.html#-'>-</a>(<span class='argstr'>aNumber</span>)</h3>
<div class='method'>
<p>Subtraction.</div><h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='-*' href='./../Overviews/Methods.html#*'>*</a>(<span class='argstr'>aNumber</span>)</h3>
<div class='method'>
<p>Multiplication.</div><h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='-/' href='./../Overviews/Methods.html#/'>/</a>(<span class='argstr'>aNumber</span>)</h3>
<div class='method'>
<p>Division.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-div' href='./../Overviews/Methods.html#div'>div</a>(<span class='argstr'>aNumber</span>)</h3>
<div class='method'>
<p>Integer division.</div><h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='-%' href='./../Overviews/Methods.html#%'>%</a>(<span class='argstr'>that</span>)</h3>
<div class='supmethod'>From superclass: <a href='./../Classes/Object.html'>Object</a></div>
<div class='method'>
<p>Modulo.</div><h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='-**' href='./../Overviews/Methods.html#**'>**</a>(<span class='argstr'>that</span>)</h3>
<div class='supmethod'>From superclass: <a href='./../Classes/Object.html'>Object</a></div>
<div class='method'>
<p>Exponentiation.</div><h3><a class='anchor' name='Polar%20Coordinate%20Support'>Polar Coordinate Support</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-rho' href='./../Overviews/Methods.html#rho'>rho</a></h3>
<div class='method'>
<p>Answer the polar radius of the number.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-theta' href='./../Overviews/Methods.html#theta'>theta</a></h3>
<div class='method'>
<p>Answer the polar angle of the number.</div><h3><a class='anchor' name='Complex%20Number%20Support'>Complex Number Support</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-real' href='./../Overviews/Methods.html#real'>real</a></h3>
<div class='method'>
<p>Answer the real part of the number.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-imag' href='./../Overviews/Methods.html#imag'>imag</a></h3>
<div class='method'>
<p>Answer the imaginary part of the number.</div><h3><a class='anchor' name='Conversion'>Conversion</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>)</h3>
<div class='method'>
<p>Create a new <a href="./../Classes/Point.html">Point</a> whose x coordinate is the receiver and whose y coordinate is aNumber.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-complex' href='./../Overviews/Methods.html#complex'>complex</a>(<span class='argstr'>imaginaryPart</span>)</h3>
<div class='method'>
<p>Create a new <a href="./../Classes/Complex.html">Complex</a> number whose real part is the receiver with the given imaginary part.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-polar' href='./../Overviews/Methods.html#polar'>polar</a>(<span class='argstr'>angle</span>)</h3>
<div class='method'>
<p>Create a new <a href="./../Classes/Polar.html">Polar</a> number whose radius is the receiver with the given angle.</div><h3><a class='anchor' name='Iteration'>Iteration</a></h3>
<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'>endValue</span>, <span class='argstr'>function</span>)</h3>
<div class='method'>
<p>Calls <strong>function</strong> for numbers from this up to endval, inclusive, stepping each time by 1.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>endValue<td class='argumentdesc'>
<p>a <a href="./../Classes/Number.html">Number</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 number from this to<tr><td class='argumentname'>(endval, and the second which is a number from zero to the number of iterations minus one.)<td class='argumentdesc'></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'>endValue</span>, <span class='argstr'>stepValue</span>, <span class='argstr'>function</span>)</h3>
<div class='method'>
<p>Calls <strong>function</strong> for numbers from this up to endval stepping each time by step.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>endValue<td class='argumentdesc'>
<p>a <a href="./../Classes/Number.html">Number</a>.<tr><td class='argumentname'>stepValue<td class='argumentdesc'>
<p>a <a href="./../Classes/Number.html">Number</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 number 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='-forSeries' href='./../Overviews/Methods.html#forSeries'>forSeries</a>(<span class='argstr'>second</span>, <span class='argstr'>last</span>, <span class='argstr'>function</span>)</h3>
<div class='method'>
<p>Calls <strong>function</strong> for numbers from this up to endval stepping each time by a step specified by second.<h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>second<td class='argumentdesc'>
<p>a <a href="./../Classes/Number.html">Number</a>.<tr><td class='argumentname'>last<td class='argumentdesc'>
<p>a <a href="./../Classes/Number.html">Number</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 number from this to endval, and the second which is a number from zero to the number of iterations minus one.</table></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='-asLayoutElement' href='./../Overviews/Methods.html#asLayoutElement'>asLayoutElement</a></h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/ext-asLayoutElement.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/ext-asLayoutElement.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-half' href='./../Overviews/Methods.html#half'>half</a></h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/DefaultLibrary/extNumber.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/DefaultLibrary/extNumber.sc</a></div>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-isNumber' href='./../Overviews/Methods.html#isNumber'>isNumber</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-mod' href='./../Overviews/Methods.html#mod'>mod</a>(<span class='argstr'>aNumber</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-performBinaryOpOnPoint' href='./../Overviews/Methods.html#performBinaryOpOnPoint'>performBinaryOpOnPoint</a>(<span class='argstr'>op</span>, <span class='argstr'>aPoint</span>, <span class='argstr'>adverb</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-performBinaryOpOnSeqColl' href='./../Overviews/Methods.html#performBinaryOpOnSeqColl'>performBinaryOpOnSeqColl</a>(<span class='argstr'>aSelector</span>, <span class='argstr'>aSeqColl</span>, <span class='argstr'>adverb</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-pow' href='./../Overviews/Methods.html#pow'>pow</a>(<span class='argstr'>aNumber</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-twice' href='./../Overviews/Methods.html#twice'>twice</a></h3>
<div class='extmethod'>From extension in <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/DefaultLibrary/extNumber.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/DefaultLibrary/extNumber.sc</a></div>
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/Number.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/Number.schelp</a><br>link::Classes/Number::<br></div></div></body></html>