NumberOps

com.phasmidsoftware.number.core.numerical.Number.NumberOps
implicit class NumberOps(x: Int)

Implicit class to operate on Numbers introduced as integers. CONSIDER reinstating the ∧ operator definitions (but they were never used). CONSIDER generalizing this to inputs of Values (or Rationals, Doubles).

Value parameters

x

an Int to be treated as a Number.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def *(y: Number): Number

Multiply x by y (a Number) and yield a Number.

Multiply x by y (a Number) and yield a Number.

Value parameters

y

the multiplicand, a Number.

Attributes

Returns

a Number whose value is x * y.

def +(y: Number): Number

Add this x (a Number) and yield a Number.

Add this x (a Number) and yield a Number.

Value parameters

y

the addend, a Number.

Attributes

Returns

a Number whose value is x + y.

def /(y: Number): Number

Divide x by y (a Number) and yield a Number.

Divide x by y (a Number) and yield a Number.

Value parameters

y

the divisor, a Number.

Attributes

Returns

a Number whose value is x / y.

def :/(y: Int): Number

Divide x by y (an Int) and yield a Number. NOTE: the colon is necessary in order to coerce the left hand operand to be a Number.

Divide x by y (an Int) and yield a Number. NOTE: the colon is necessary in order to coerce the left hand operand to be a Number.

Value parameters

y

the divisor, an Int.

Attributes

Returns

a Number whose value is x / y.