IntRational

com.phasmidsoftware.number.core.inner.IntRational
object IntRational

An object providing an extractor method for converting a Rational number into a pair of integers representing its numerator and denominator.

The IntRational object simplifies working with Rational numbers when you need to decompose them into integers for further processing or pattern matching.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def unapply(x: Rational): Option[(Int, Int)]

Extracts the numerator and denominator of a Rational number as a pair of integers.

Extracts the numerator and denominator of a Rational number as a pair of integers.

Value parameters

x

the Rational number to be decomposed

Attributes

Returns

an Option containing a tuple of two integers (numerator, denominator) if the decomposition is successful; None otherwise