RingFunctions

object BoolRing.type
object CommutativeRing.type
object DivisionRing.type
object EuclideanRing.type
object Field.type
object GCDRing.type
object Ring.type

Value members

Concrete methods

final def defaultFromBigInt[@specialized(Int, Long, Float, Double) A](n: BigInt)(implicit ev: R[A]): A
final def defaultFromDouble[A](a: Double)(implicit ringA: Ring[A], mgA: MultiplicativeGroup[A]): A

Returns the given Double, understood as a rational number, in the provided (division) ring.

Returns the given Double, understood as a rational number, in the provided (division) ring.

This is implemented in terms of basic ops. However, this is probably significantly less efficient than can be done with a specific type. So, it is recommended to specialize this general method.

def fromBigInt[@specialized(Int, Long, Float, Double) A](n: BigInt)(implicit ev: R[A]): A
def fromInt[@specialized(Int, Long, Float, Double) A](n: Int)(implicit ev: R[A]): A

Inherited methods

def isAdditiveCommutative[A](implicit ev: R[A]): Boolean
def isOne[@specialized(Int, Long, Float, Double) A](a: A)(implicit ev0: R[A], ev1: Eq[A]): Boolean
def isZero[@specialized(Int, Long, Float, Double) A](a: A)(implicit ev0: R[A], ev1: Eq[A]): Boolean
def minus[@specialized(Int, Long, Float, Double) A](x: A, y: A)(implicit ev: R[A]): A
Inherited from:
AdditiveGroupFunctions
def negate[@specialized(Int, Long, Float, Double) A](x: A)(implicit ev: R[A]): A
Inherited from:
AdditiveGroupFunctions
def one[@specialized(Int, Long, Float, Double) A](implicit ev: R[A]): A
def plus[@specialized(Int, Long, Float, Double) A](x: A, y: A)(implicit ev: R[A]): A
def pow[@specialized(Int, Long, Float, Double) A](a: A, n: Int)(implicit ev: R[A]): A
@nowarn("msg=deprecated")
def product[@specialized(Int, Long, Float, Double) A](as: IterableOnce[A])(implicit ev: R[A]): A
@nowarn("msg=deprecated")
def sum[@specialized(Int, Long, Float, Double) A](as: IterableOnce[A])(implicit ev: R[A]): A
def sumN[@specialized(Int, Long, Float, Double) A](a: A, n: Int)(implicit ev: R[A]): A
def times[@specialized(Int, Long, Float, Double) A](x: A, y: A)(implicit ev: R[A]): A
@nowarn("msg=deprecated")
def tryProduct[A](as: IterableOnce[A])(implicit ev: R[A]): Option[A]
@nowarn("msg=deprecated")
def trySum[A](as: IterableOnce[A])(implicit ev: R[A]): Option[A]
def zero[@specialized(Int, Long, Float, Double) A](implicit ev: R[A]): A