spire.math

Numeric

trait Numeric[A] extends Ring[A] with AdditiveAbGroup[A] with MultiplicativeAbGroup[A] with NRoot[A] with ConvertableFrom[A] with ConvertableTo[A] with IsReal[A]

TODO 3. LiteralOps? Literal conversions? 4. Review operator symbols? 5. Support for more operators? 6. Start to worry about things like e.g. pow(BigInt, BigInt)

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Numeric
  2. IsReal
  3. Signed
  4. Order
  5. PartialOrder
  6. Eq
  7. ConvertableTo
  8. ConvertableFrom
  9. NRoot
  10. MultiplicativeAbGroup
  11. MultiplicativeCMonoid
  12. MultiplicativeCSemigroup
  13. MultiplicativeGroup
  14. Ring
  15. Rng
  16. AdditiveAbGroup
  17. AdditiveCMonoid
  18. AdditiveCSemigroup
  19. AdditiveGroup
  20. Rig
  21. MultiplicativeMonoid
  22. Semiring
  23. MultiplicativeSemigroup
  24. AdditiveMonoid
  25. AdditiveSemigroup
  26. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def abs(a: A): A

    An idempotent function that ensures an object has a non-negative sign.

    An idempotent function that ensures an object has a non-negative sign.

    Definition Classes
    Signed
  2. abstract def ceil(a: A): A

    Rounds a the nearest integer that is greater than or equal to a.

    Rounds a the nearest integer that is greater than or equal to a.

    Definition Classes
    IsReal
  3. abstract def compare(x: A, y: A): Int

    Definition Classes
    Order
  4. abstract def div(x: A, y: A): A

    Definition Classes
    MultiplicativeGroup
  5. abstract def floor(a: A): A

    Rounds a the nearest integer that is less than or equal to a.

    Rounds a the nearest integer that is less than or equal to a.

    Definition Classes
    IsReal
  6. abstract def fpow(a: A, b: A): A

    Definition Classes
    NRoot
  7. abstract def fromAlgebraic(n: Algebraic): A

    Definition Classes
    ConvertableTo
  8. abstract def fromBigDecimal(n: BigDecimal): A

    Definition Classes
    ConvertableTo
  9. abstract def fromBigInt(n: BigInt): A

    Definition Classes
    ConvertableTo
  10. abstract def fromByte(n: Byte): A

    Definition Classes
    ConvertableTo
  11. abstract def fromDouble(n: Double): A

    Definition Classes
    ConvertableTo
  12. abstract def fromFloat(n: Float): A

    Definition Classes
    ConvertableTo
  13. abstract def fromLong(n: Long): A

    Definition Classes
    ConvertableTo
  14. abstract def fromRational(n: Rational): A

    Definition Classes
    ConvertableTo
  15. abstract def fromReal(n: Real): A

    Definition Classes
    ConvertableTo
  16. abstract def fromShort(n: Short): A

    Definition Classes
    ConvertableTo
  17. abstract def fromType[B](b: B)(implicit arg0: ConvertableFrom[B]): A

    Definition Classes
    ConvertableTo
  18. abstract def getClass(): Class[_]

    Definition Classes
    Any
  19. abstract def isWhole(a: A): Boolean

    Returns true iff a is a an integer.

    Returns true iff a is a an integer.

    Definition Classes
    IsReal
  20. abstract def negate(x: A): A

    Definition Classes
    AdditiveGroup
  21. abstract def nroot(a: A, n: Int): A

    Definition Classes
    NRoot
  22. abstract def one: A

    Definition Classes
    MultiplicativeMonoid
  23. abstract def plus(x: A, y: A): A

    Definition Classes
    AdditiveSemigroup
  24. abstract def round(a: A): A

    Rounds a to the nearest integer.

    Rounds a to the nearest integer.

    Definition Classes
    IsReal
  25. abstract def signum(a: A): Int

    Returns 0 if a is 0, > 0 if a is positive, and < 0 is a is negative.

    Returns 0 if a is 0, > 0 if a is positive, and < 0 is a is negative.

    Definition Classes
    Signed
  26. abstract def times(x: A, y: A): A

    Definition Classes
    MultiplicativeSemigroup
  27. abstract def toAlgebraic(a: A): Algebraic

    Definition Classes
    ConvertableFrom
  28. abstract def toBigDecimal(a: A): BigDecimal

    Definition Classes
    ConvertableFrom
  29. abstract def toBigInt(a: A): BigInt

    Definition Classes
    ConvertableFrom
  30. abstract def toByte(a: A): Byte

    Definition Classes
    ConvertableFrom
  31. abstract def toDouble(a: A): Double

    Approximates a as a Double.

    Approximates a as a Double.

    Definition Classes
    IsReal
  32. abstract def toFloat(a: A): Float

    Definition Classes
    ConvertableFrom
  33. abstract def toInt(a: A): Int

    Definition Classes
    ConvertableFrom
  34. abstract def toLong(a: A): Long

    Definition Classes
    ConvertableFrom
  35. abstract def toNumber(a: A): Number

    Definition Classes
    ConvertableFrom
  36. abstract def toRational(a: A): Rational

    Definition Classes
    ConvertableFrom
  37. abstract def toReal(a: A): Real

    Definition Classes
    IsReal
  38. abstract def toShort(a: A): Short

    Definition Classes
    ConvertableFrom
  39. abstract def toString(a: A): String

    Definition Classes
    ConvertableFrom
  40. abstract def toType[B](a: A)(implicit arg0: ConvertableTo[B]): B

    Definition Classes
    ConvertableFrom
  41. abstract def zero: A

    Definition Classes
    AdditiveMonoid

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  4. def additive: AbGroup[A]

  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def equals(arg0: Any): Boolean

    Definition Classes
    Any
  7. def eqv(x: A, y: A): Boolean

    Returns true if x and y are equivalent, false otherwise.

    Returns true if x and y are equivalent, false otherwise.

    Definition Classes
    OrderPartialOrderEq
  8. def fromInt(n: Int): A

    Defined to be equivalent to additive.sumn(one, n).

    Defined to be equivalent to additive.sumn(one, n). That is, n repeated summations of this ring's one, or -one if n is negative.

    Definition Classes
    Ring
  9. def gt(x: A, y: A): Boolean

    Definition Classes
    OrderPartialOrder
  10. def gteqv(x: A, y: A): Boolean

    Definition Classes
    OrderPartialOrder
  11. def hashCode(): Int

    Definition Classes
    Any
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. def isOne(a: A)(implicit ev: Eq[A]): Boolean

    Definition Classes
    MultiplicativeMonoid
  14. def isSignNegative(a: A): Boolean

    Definition Classes
    Signed
  15. def isSignNonNegative(a: A): Boolean

    Definition Classes
    Signed
  16. def isSignNonPositive(a: A): Boolean

    Definition Classes
    Signed
  17. def isSignNonZero(a: A): Boolean

    Definition Classes
    Signed
  18. def isSignPositive(a: A): Boolean

    Definition Classes
    Signed
  19. def isSignZero(a: A): Boolean

    Definition Classes
    Signed
  20. def isZero(a: A)(implicit ev: Eq[A]): Boolean

    Tests if a is zero.

    Tests if a is zero.

    Definition Classes
    AdditiveMonoid
  21. def lt(x: A, y: A): Boolean

    Definition Classes
    OrderPartialOrder
  22. def lteqv(x: A, y: A): Boolean

    Definition Classes
    OrderPartialOrder
  23. def max(x: A, y: A): A

    Definition Classes
    Order
  24. def min(x: A, y: A): A

    Definition Classes
    Order
  25. def minus(x: A, y: A): A

    Definition Classes
    AdditiveGroup
  26. def multiplicative: AbGroup[A]

  27. def neqv(x: A, y: A): Boolean

    Returns false if x and y are equivalent, true otherwise.

    Returns false if x and y are equivalent, true otherwise.

    Definition Classes
    Eq
  28. def on[B](f: (B) ⇒ A): Order[B]

    Defines an order on B by mapping B to A using f and using As order to order B.

    Defines an order on B by mapping B to A using f and using As order to order B.

    Definition Classes
    OrderPartialOrderEq
  29. def partialCompare(x: A, y: A): Double

    Result of comparing x with y.

    Result of comparing x with y. Returns NaN if operands are not comparable. If operands are comparable, returns a Double whose sign is: - negative iff x < y - zero iff x === y - positive iff x > y

    Definition Classes
    OrderPartialOrder
  30. def pmax(x: A, y: A): Option[A]

    Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

    Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

    Definition Classes
    PartialOrder
  31. def pmin(x: A, y: A): Option[A]

    Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

    Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

    Definition Classes
    PartialOrder
  32. def pow(a: A, n: Int): A

    This is similar to Semigroup#pow, except that a pow 0 is defined to be the multiplicative identity.

    This is similar to Semigroup#pow, except that a pow 0 is defined to be the multiplicative identity.

    Definition Classes
    RigSemiring
  33. def prod(as: TraversableOnce[A]): A

    Given a sequence of as, sum them using the monoid and return the total.

    Given a sequence of as, sum them using the monoid and return the total.

    Definition Classes
    MultiplicativeMonoid
  34. def prodOption(as: TraversableOnce[A]): Option[A]

    Given a sequence of as, sum them using the semigroup and return the total.

    Given a sequence of as, sum them using the semigroup and return the total.

    If the sequence is empty, returns None. Otherwise, returns Some(total).

    Definition Classes
    MultiplicativeSemigroup
  35. def prodn(a: A, n: Int): A

    Return a multiplicated with itself n times.

    Return a multiplicated with itself n times.

    Definition Classes
    MultiplicativeGroupMultiplicativeMonoidMultiplicativeSemigroup
  36. def prodnAboveOne(a: A, n: Int): A

    Attributes
    protected
    Definition Classes
    MultiplicativeSemigroup
  37. def reciprocal(x: A): A

    Definition Classes
    MultiplicativeGroup
  38. def reverse: Order[A]

    Defines an ordering on A where all arrows switch direction.

    Defines an ordering on A where all arrows switch direction.

    Definition Classes
    OrderPartialOrder
  39. def sign(a: A): Sign

    Returns Zero if a is 0, Positive if a is positive, and Negative is a is negative.

    Returns Zero if a is 0, Positive if a is positive, and Negative is a is negative.

    Definition Classes
    Signed
  40. def sqrt(a: A): A

    Definition Classes
    NRoot
  41. def sum(as: TraversableOnce[A]): A

    Given a sequence of as, sum them using the monoid and return the total.

    Given a sequence of as, sum them using the monoid and return the total.

    Definition Classes
    AdditiveMonoid
  42. def sumOption(as: TraversableOnce[A]): Option[A]

    Given a sequence of as, sum them using the semigroup and return the total.

    Given a sequence of as, sum them using the semigroup and return the total.

    If the sequence is empty, returns None. Otherwise, returns Some(total).

    Definition Classes
    AdditiveSemigroup
  43. def sumn(a: A, n: Int): A

    Return a added with itself n times.

    Return a added with itself n times.

    Definition Classes
    AdditiveGroupAdditiveMonoidAdditiveSemigroup
  44. def sumnAboveOne(a: A, n: Int): A

    Attributes
    protected
    Definition Classes
    AdditiveSemigroup
  45. def toString(): String

    Definition Classes
    Any
  46. def tryCompare(x: A, y: A): Option[Int]

    Result of comparing x with y.

    Result of comparing x with y. Returns None if operands are not comparable. If operands are comparable, returns Some[Int] where the Int sign is: - negative iff x < y - zero iff x == y - positive iff x > y

    Definition Classes
    PartialOrder

Inherited from IsReal[A]

Inherited from Signed[A]

Inherited from Order[A]

Inherited from PartialOrder[A]

Inherited from Eq[A]

Inherited from ConvertableTo[A]

Inherited from ConvertableFrom[A]

Inherited from NRoot[A]

Inherited from MultiplicativeAbGroup[A]

Inherited from MultiplicativeCMonoid[A]

Inherited from MultiplicativeCSemigroup[A]

Inherited from MultiplicativeGroup[A]

Inherited from Ring[A]

Inherited from Rng[A]

Inherited from AdditiveAbGroup[A]

Inherited from AdditiveCMonoid[A]

Inherited from AdditiveCSemigroup[A]

Inherited from AdditiveGroup[A]

Inherited from Rig[A]

Inherited from MultiplicativeMonoid[A]

Inherited from Semiring[A]

Inherited from MultiplicativeSemigroup[A]

Inherited from AdditiveMonoid[A]

Inherited from AdditiveSemigroup[A]

Inherited from Any

Ungrouped