UniqueFactorizationDomain

trait UniqueFactorizationDomain[@specialized(Byte, Short, Int, Long) A]

A unique factorization domain is a commutative ring in which each element can be written as a product of prime elements and a unit.

Unique factorization domains are GCD rings (or domains), but not necessarily Euclidean domains.

This trait is outside the commutative ring hierarchy, because the factorization algorithms are costly. Another reason: in some cases, a deliberate choice should be made by the user, for example to use probabilistic algorithms with a specified probability of failure.

Companion
object
class Any

Value members

Abstract methods

def factor(a: A): Decomposition[A]

Returns the factors of the given nonzero element.

Returns the factors of the given nonzero element.

def isPrime(a: A): Boolean

Tests whether the given nonzero element is prime.

Tests whether the given nonzero element is prime.