Classes | Math

# Number : Magnitude : Object

Mathematical quantity
Source: Number.sc

## Description

Number represents a mathematical quantity.

## Instance Methods

Subtraction.

Multiplication.

Division.

### .div(aNumber)

Integer division.

### %(that)

From superclass: Object

Modulo.

### **(that)

From superclass: Object

Exponentiation.

### .theta

Answer the polar angle of the number.

### .real

Answer the real part of the number.

### .imag

Answer the imaginary part of the number.

### @(aValue)

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.

### @(aValue)

If aValue is Number, create a new Point whose x coordinate is the receiver and whose y coordinate is Number. If aValue is a Point, create a new Cartesian whose x coordinate is the receiver, y coordinate is aValue.x and z coordinate is aValue.y.

 aValue

### .spherical(theta, phi)

Create a new Spherical number whose radius is the receiver with the given angles.

#### Arguments:

 theta azimuth angle phi elevation angle

### .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.

### .theta

Answer the spherical azimuth angle of the number.

### .phi

Answer the spherical elevation angle of the number.