Z

com.phasmidsoftware.number.algebra.core.Z
trait Z extends Q

Trait Z represents a structure that can potentially be converted to an integer representation. This abstraction can be used in scenarios where values may or may not fit within the bounds of a 32-bit signed integer.

Attributes

Graph
Supertypes
trait Q
trait R
class Object
trait Matchable
class Any
Known subtypes
trait N
trait Nat
object NatZero
class Succ
class WholeNumber

Members list

Value members

Abstract methods

def toInt: Int

Converts this instance into its integer representation.

Converts this instance into its integer representation.

Attributes

Returns

the integer value corresponding to this instance

Inherited and Abstract methods

def asDouble: Double

Converts the current instance to a Double representation. CONSIDER changing to maybeDouble returning Option[Double].

Converts the current instance to a Double representation. CONSIDER changing to maybeDouble returning Option[Double].

Attributes

Returns

the Double value corresponding to the current instance

Inherited from:
R
def maybeQ: Option[Q]

Returns an optional instance of Q from this R value.

Returns an optional instance of Q from this R value.

Attributes

Returns

an optional instance of Q representing this specified R value

Inherited from:
R
def maybeZ: Option[Z]

Retrieves an optional instance of Z if it exists.

Retrieves an optional instance of Z if it exists.

Attributes

Returns

an Option[Z] that contains a Z instance if it's available, or None if not.

Inherited from:
Q

Converts this instance of Q to its corresponding rational representation.

Converts this instance of Q to its corresponding rational representation.

Attributes

Returns

a Rational instance representing the current value

Inherited from:
Q