given_Modulo_Rational

com.phasmidsoftware.number.core.inner.Modulo.given_Modulo_Rational

Given instance for Rational numbers. Requires the RationalFloor extension to be in scope.

Attributes

Graph
Supertypes
trait Modulo[Rational]
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def compare(x: Rational, y: Rational): Int

Compare two values. Returns negative if x < y, zero if x == y, positive if x > y.

Compare two values. Returns negative if x < y, zero if x == y, positive if x > y.

Attributes

Subtract two values.

Subtract two values.

Attributes

def mod(x: Rational, m: Rational): Rational

Compute the modulo of x with respect to m. The result should always be in the range [0, m) for positive m.

Compute the modulo of x with respect to m. The result should always be in the range [0, m) for positive m.

Value parameters

m

the modulus

x

the value to normalize

Attributes

Returns

x mod m

Add two values.

Add two values.

Attributes

Concrete fields

lazy val zero: Rational

The zero value for this numeric type.

The zero value for this numeric type.

Attributes