Packages

package numbers

Number System.

Each number system S (derived from org.opentorah.numbers.Numbers#Number) supports two flavors of org.opentorah.numbers.Numbers#Number: S#Point (derived from org.opentorah.numbers.Numbers#PointNumber and S#Vector (derived from org.opentorah.numbers.Numbers#VectorNumber.

This distinction allows definitions of operations to be constrained to the types where a give operation makes sense: -: (Vector, Vector) => Vector with right unit Vector.zero; +: (Vector, Vector) => Vector with unit Vector.zero; -: (Point, Point) => Vector; +: (Point, Vector) => Point with left unit Point.zero and its "commutation" +: (Vector, Point) => Point with right unit Point.zero.

This distinction may seem to be artificial: after all, given operations -: (Point, Point) => Vector and +: (Point, Vector) => Point, we have an isomorphism between Points and Vectors: ptov(p) = p - Point.zero, vtop(v) = Point.zero + v.

Indeed, there is not much difference between the two when we are talking about angles. However, for dates (Points) it makes sense to ask what year/month the date is in - but not for time intervals (Vectors)!

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. numbers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class BigRational extends Comparable[BigRational] with Ordered[BigRational] with Product with Serializable

    Arbitrary precision Rational number.

    Arbitrary precision Rational number.

    Numerator is a BigInteger; denominator is a non-zero BigInteger. If numerator is zero, resulting BigRational is zero (denominator is ignored).

    Representation is canonical: - sign of the BigRational is kept in the numerator; - denominator is always positive; - numerator and denominator do not have common divisors.

  2. trait Convertible[T] extends AnyRef

    Operations needed to convert to/from T.

    Operations needed to convert to/from T.

    T

    type of the number to convert to/from

  3. trait Digit extends AnyRef
  4. type Digits = Seq[Int]
  5. trait DigitsDescriptor extends AnyRef
  6. trait NonPeriodicNumbers extends Numbers
  7. trait Numbers extends AnyRef
  8. trait PeriodicNumbers extends Numbers
  9. trait Zeroable[T] extends AnyRef

    Operations needed to find a zero crossing of a function.

    Operations needed to find a zero crossing of a function.

    T

    type of the number to convert to/from

Value Members

  1. object BigRational extends Serializable
  2. object Convertible
  3. object Math
  4. object Zeroable

Inherited from AnyRef

Inherited from Any

Ungrouped