Fraction
Fraction inherits from Number and defines instance variables numerator, denominator. It has no subclasses.
Fractions are rational numbers.
The numerator and denominator of a Fraction are assumed to be Integers---and are therefore affected by the same restrictions imposed on Integers (see the comment of Integer for explanation).
Methods defined in Fraction:
Methods for accessing:
Methods for arithmetic:
- - number
- * number
- / number
- // number
- + number
Methods for comparing:
Methods for converting:
- asDouble
- asFraction
- asInteger
Methods for double dispatching:
- addToFraction: fraction
- addToInteger: integer
- coerce: number
- divideIntoFraction: fraction
- divideIntoInteger: integer
- equalToFraction: fraction
- equalToInteger: integer
Always false, since Fractions are assumed to be non-integer rationals.
- generality
- greaterThanFraction: fraction
- greaterThanInteger: integer
- multiplyByFraction: fraction
- multiplyByInteger: integer
- subtractFromFraction: fraction
- subtractFromInteger: integer
Methods for initialization:
- numerator: n denominator: d
Methods for math functions:
- negated
- reciprocal
- truncated
Methods for predicates:
Methods for printing:
Pocket Smalltalk Documentation