Skip to content

Latest commit

 

History

History
52 lines (43 loc) · 1.66 KB

arith.rst

File metadata and controls

52 lines (43 loc) · 1.66 KB

Arith

Type class used to supply evidence that type T has basic arithmetic operations defined on it.


Abstract methods

trait Arith[T]
def negate(x: T): T
Returns the negation of the given value.
def plus(x: T, y: T): T
Returns the result of adding x and y.
def minus(x: T, y: T): T
Returns the result of subtracting y from x.
def times(x: T, y: T): T
Returns the result of multiplying x and y.
def divide(x: T, y: T): T
Returns the result of dividing x by y.