Classes | Math

# Number : Magnitude : Object

Mathematical quantity
Source: Number.sc
Subclasses: Complex, Polar, SimpleNumber

## Description

Number represents a mathematical quantity.

## Class Methods

### Inherited class methods

## Instance Methods

### Math

### +(aNumber)

Addition.

### -(aNumber)

Subtraction.

### *(aNumber)

Multiplication.

### /(aNumber)

Division.

### .div(aNumber)

Integer division.

### %(that)

From superclass: Object

Modulo.

### **(that)

From superclass: Object

Exponentiation.

### Polar Coordinate Support

### .rho

Answer the polar radius of the number.

### .theta

Answer the polar angle of the number.

### Complex Number Support

### .real

Answer the real part of the number.

### .imag

Answer the imaginary part of the number.

### Conversion

### @(aNumber)

Create a new Point whose x coordinate is the receiver and whose y coordinate is aNumber.

### .complex(imaginaryPart)

Create a new Complex number whose real part is the receiver with the given imaginary part.

### .polar(angle)

Create a new Polar number whose radius is the receiver with the given angle.

### Iteration

### .for(endValue, function)

Calls function for numbers from this up to endval, inclusive, stepping each time by 1.

#### Arguments:

endValue | a Number.
function | a Function 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.) |

### .forBy(endValue, stepValue, function)

Calls function for numbers from this up to endval stepping each time by step.

#### Arguments:

endValue | a Number.
stepValue | a Number.
function | a Function 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.

### .forSeries(second, last, function)

Calls function for numbers from this up to endval stepping each time by a step specified by second.

#### Arguments:

second | a Number.
last | a Number.
function | a Function 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.

### Inherited instance methods

### Undocumented instance methods

### .asLayoutElement

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/Base/ext-asLayoutElement.sc

### .half

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/DefaultLibrary/extNumber.sc

### .isNumber

### .mod(aNumber)

### .performBinaryOpOnPoint(op, aPoint, adverb)

### .performBinaryOpOnSeqColl(aSelector, aSeqColl, adverb)

### .pow(aNumber)

### .twice

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/DefaultLibrary/extNumber.sc
helpfile source: /Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/Number.schelp
link::Classes/Number::