# Number

Number inherits from Object and defines no instance variables. It has subclasses Double, Fraction, Integer, and Point.

Numbers are numeric values of various kinds.
Number has the protocol normally found in class Magnitude (there is no separate Magnitude class). In addition, the usual Number methods are implemented here.

## Methods defined in Number:

### Methods for comparing:

- < number
- <= number
- = number
- > number
- >= number
- between: lower and: upper
- hash

### Methods for double dispatching:

- addToDouble: double
- addToFraction: fraction
- addToInteger: integer
- addToPoint: point
- coerce: number
  Coerce a lower-generality number to the same generality as the receiver (if possible).
- divideIntoDouble: double
- divideIntoFraction: fraction
- divideIntoInteger: integer
- divideIntoPoint: point
- equalToDouble: double
- equalToFraction: fraction
- equalToInteger: integer
- equalToPoint: point
- generality
- greaterThanDouble: double
- greaterThanFraction: fraction
- greaterThanInteger: integer
- greaterThanPoint: point
- multiplyByDouble: double
- multiplyByFraction: fraction
- multiplyByInteger: integer
- multiplyByPoint: point
- retry: selector coercing: number
- subtractFromDouble: double
- subtractFromFraction: fraction
- subtractFromInteger: integer
- subtractFromPoint: point

### Methods for instance creation:

- @ y
- to: stop
- to: stop by: step

### Methods for math functions:

- abs
- max: value
- min: value
- negated
- raisedToInteger: integer
- reciprocal
- sign
- squared

### Methods for predicates:

- isInteger
- isZero
- negative
- positive
  arrgh, I hate this definition, but it's what we're stuck with.

Pocket Smalltalk Documentation