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)
- Alphabetic
- By Inheritance
- Numeric
- IsReal
- Signed
- Order
- PartialOrder
- Eq
- ConvertableTo
- ConvertableFrom
- NRoot
- MultiplicativeAbGroup
- MultiplicativeCMonoid
- MultiplicativeCSemigroup
- MultiplicativeGroup
- Ring
- Rng
- AdditiveAbGroup
- AdditiveCMonoid
- AdditiveCSemigroup
- AdditiveGroup
- Rig
- MultiplicativeMonoid
- Semiring
- MultiplicativeSemigroup
- AdditiveMonoid
- AdditiveSemigroup
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
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
-
abstract
def
ceil(a: A): A
Rounds
athe nearest integer that is greater than or equal toa.Rounds
athe nearest integer that is greater than or equal toa.- Definition Classes
- IsReal
-
abstract
def
compare(x: A, y: A): Int
- Definition Classes
- Order
-
abstract
def
div(x: A, y: A): A
- Definition Classes
- MultiplicativeGroup
-
abstract
def
floor(a: A): A
Rounds
athe nearest integer that is less than or equal toa.Rounds
athe nearest integer that is less than or equal toa.- Definition Classes
- IsReal
-
abstract
def
fpow(a: A, b: A): A
- Definition Classes
- NRoot
-
abstract
def
fromAlgebraic(n: Algebraic): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromBigDecimal(n: BigDecimal): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromBigInt(n: BigInt): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromByte(n: Byte): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromDouble(n: Double): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromFloat(n: Float): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromLong(n: Long): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromRational(n: Rational): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromReal(n: Real): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromShort(n: Short): A
- Definition Classes
- ConvertableTo
-
abstract
def
fromType[B](b: B)(implicit arg0: ConvertableFrom[B]): A
- Definition Classes
- ConvertableTo
-
abstract
def
getClass(): Class[_]
- Definition Classes
- Any
-
abstract
def
isWhole(a: A): Boolean
Returns
trueiffais a an integer.Returns
trueiffais a an integer.- Definition Classes
- IsReal
-
abstract
def
negate(x: A): A
- Definition Classes
- AdditiveGroup
-
abstract
def
nroot(a: A, n: Int): A
- Definition Classes
- NRoot
-
abstract
def
one: A
- Definition Classes
- MultiplicativeMonoid
-
abstract
def
plus(x: A, y: A): A
- Definition Classes
- AdditiveSemigroup
-
abstract
def
round(a: A): A
Rounds
ato the nearest integer.Rounds
ato the nearest integer.- Definition Classes
- IsReal
-
abstract
def
signum(a: A): Int
Returns 0 if
ais 0, > 0 ifais positive, and < 0 isais negative.Returns 0 if
ais 0, > 0 ifais positive, and < 0 isais negative.- Definition Classes
- Signed
-
abstract
def
times(x: A, y: A): A
- Definition Classes
- MultiplicativeSemigroup
-
abstract
def
toAlgebraic(a: A): Algebraic
- Definition Classes
- ConvertableFrom
-
abstract
def
toBigDecimal(a: A): BigDecimal
- Definition Classes
- ConvertableFrom
-
abstract
def
toBigInt(a: A): BigInt
- Definition Classes
- ConvertableFrom
-
abstract
def
toByte(a: A): Byte
- Definition Classes
- ConvertableFrom
-
abstract
def
toDouble(a: A): Double
Approximates
aas aDouble.Approximates
aas aDouble.- Definition Classes
- IsReal
-
abstract
def
toFloat(a: A): Float
- Definition Classes
- ConvertableFrom
-
abstract
def
toInt(a: A): Int
- Definition Classes
- ConvertableFrom
-
abstract
def
toLong(a: A): Long
- Definition Classes
- ConvertableFrom
-
abstract
def
toNumber(a: A): Number
- Definition Classes
- ConvertableFrom
-
abstract
def
toRational(a: A): Rational
- Definition Classes
- ConvertableFrom
-
abstract
def
toReal(a: A): Real
- Definition Classes
- IsReal
-
abstract
def
toShort(a: A): Short
- Definition Classes
- ConvertableFrom
-
abstract
def
toString(a: A): String
- Definition Classes
- ConvertableFrom
-
abstract
def
toType[B](a: A)(implicit arg0: ConvertableTo[B]): B
- Definition Classes
- ConvertableFrom
-
abstract
def
zero: A
- Definition Classes
- AdditiveMonoid
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
def
additive: AbGroup[A]
- Definition Classes
- AdditiveAbGroup → AdditiveCMonoid → AdditiveCSemigroup → AdditiveGroup → AdditiveMonoid → AdditiveSemigroup
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
equals(arg0: Any): Boolean
- Definition Classes
- Any
-
def
eqv(x: A, y: A): Boolean
Returns
trueifxandyare equivalent,falseotherwise.Returns
trueifxandyare equivalent,falseotherwise.- Definition Classes
- Order → PartialOrder → Eq
-
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,nrepeated summations of this ring'sone, or-oneifnis negative.- Definition Classes
- Ring
-
def
gt(x: A, y: A): Boolean
- Definition Classes
- Order → PartialOrder
-
def
gteqv(x: A, y: A): Boolean
- Definition Classes
- Order → PartialOrder
-
def
hashCode(): Int
- Definition Classes
- Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isOne(a: A)(implicit ev: Eq[A]): Boolean
- Definition Classes
- MultiplicativeMonoid
-
def
isSignNegative(a: A): Boolean
- Definition Classes
- Signed
-
def
isSignNonNegative(a: A): Boolean
- Definition Classes
- Signed
-
def
isSignNonPositive(a: A): Boolean
- Definition Classes
- Signed
-
def
isSignNonZero(a: A): Boolean
- Definition Classes
- Signed
-
def
isSignPositive(a: A): Boolean
- Definition Classes
- Signed
-
def
isSignZero(a: A): Boolean
- Definition Classes
- Signed
-
def
isZero(a: A)(implicit ev: Eq[A]): Boolean
Tests if
ais zero.Tests if
ais zero.- Definition Classes
- AdditiveMonoid
-
def
lt(x: A, y: A): Boolean
- Definition Classes
- Order → PartialOrder
-
def
lteqv(x: A, y: A): Boolean
- Definition Classes
- Order → PartialOrder
-
def
max(x: A, y: A): A
- Definition Classes
- Order
-
def
min(x: A, y: A): A
- Definition Classes
- Order
-
def
minus(x: A, y: A): A
- Definition Classes
- AdditiveGroup
-
def
multiplicative: AbGroup[A]
- Definition Classes
- MultiplicativeAbGroup → MultiplicativeCMonoid → MultiplicativeCSemigroup → MultiplicativeGroup → MultiplicativeMonoid → MultiplicativeSemigroup
-
def
neqv(x: A, y: A): Boolean
Returns
falseifxandyare equivalent,trueotherwise.Returns
falseifxandyare equivalent,trueotherwise.- Definition Classes
- Eq
-
def
on[B](f: (B) ⇒ A): Order[B]
Defines an order on
Bby mappingBtoAusingfand usingAs order to orderB.Defines an order on
Bby mappingBtoAusingfand usingAs order to orderB.- Definition Classes
- Order → PartialOrder → Eq
-
def
partialCompare(x: A, y: A): Double
Result of comparing
xwithy.Result of comparing
xwithy. Returns NaN if operands are not comparable. If operands are comparable, returns a Double whose sign is: - negative iffx < y- zero iffx === y- positive iffx > y- Definition Classes
- Order → PartialOrder
-
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
-
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
-
def
pow(a: A, n: Int): A
This is similar to
Semigroup#pow, except thata pow 0is defined to be the multiplicative identity. -
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
-
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
-
def
prodn(a: A, n: Int): A
Return
amultiplicated with itselfntimes.Return
amultiplicated with itselfntimes.- Definition Classes
- MultiplicativeGroup → MultiplicativeMonoid → MultiplicativeSemigroup
-
def
prodnAboveOne(a: A, n: Int): A
- Attributes
- protected
- Definition Classes
- MultiplicativeSemigroup
-
def
reciprocal(x: A): A
- Definition Classes
- MultiplicativeGroup
-
def
reverse: Order[A]
Defines an ordering on
Awhere all arrows switch direction.Defines an ordering on
Awhere all arrows switch direction.- Definition Classes
- Order → PartialOrder
-
def
sign(a: A): Sign
Returns Zero if
ais 0, Positive ifais positive, and Negative isais negative.Returns Zero if
ais 0, Positive ifais positive, and Negative isais negative.- Definition Classes
- Signed
-
def
sqrt(a: A): A
- Definition Classes
- NRoot
-
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
-
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
-
def
sumn(a: A, n: Int): A
Return
aadded with itselfntimes.Return
aadded with itselfntimes.- Definition Classes
- AdditiveGroup → AdditiveMonoid → AdditiveSemigroup
-
def
sumnAboveOne(a: A, n: Int): A
- Attributes
- protected
- Definition Classes
- AdditiveSemigroup
-
def
toString(): String
- Definition Classes
- Any
-
def
tryCompare(x: A, y: A): Option[Int]
Result of comparing
xwithy.Result of comparing
xwithy. Returns None if operands are not comparable. If operands are comparable, returns Some[Int] where the Int sign is: - negative iffx < y- zero iffx == y- positive iffx > y- Definition Classes
- PartialOrder