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)!
- Alphabetic
- By Inheritance
- numbers
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- 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.
- 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
- trait Digit extends AnyRef
- type Digits = Seq[Int]
- trait DigitsDescriptor extends AnyRef
- trait NonPeriodicNumbers extends Numbers
- trait Numbers extends AnyRef
- trait PeriodicNumbers extends Numbers
- 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
- object BigRational extends Serializable
- object Convertible
- object Math
- object Zeroable