trait ExactIntegral[T] extends ExactNumeric[T]
Type-class which defines the operations on Integral types (Byte, Short, Int, Long, BigInt) with overflow checks.
An exception is raised when an overflow is detected.
Each concrete instance of this type-class overrides three methods plus
, minus
,
times
.
By default all the methods are implemented by delegating to the corresponding Integral instance from the standard Scala library.
This trait is used in core IR to avoid implicitly using standard scala implementations.
- Alphabetic
- By Inheritance
- ExactIntegral
- ExactNumeric
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
minus(x: T, y: T): T
Subtraction operation
x - y
.Subtraction operation
x - y
.- Definition Classes
- ExactNumeric
-
abstract
val
n: Integral[T]
- Attributes
- protected
- Definition Classes
- ExactIntegral → ExactNumeric
-
abstract
def
plus(x: T, y: T): T
Addition operation
x + y
.Addition operation
x + y
.- Definition Classes
- ExactNumeric
-
abstract
def
times(x: T, y: T): T
Multiplication operation
x * y
.Multiplication operation
x * y
.- Definition Classes
- ExactNumeric
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
divisionRemainder(x: T, y: T): T
Operation which returns remainder from dividing x by y.
Operation which returns remainder from dividing x by y. The exact rules are defined in the concrete instance of the type T. A default implementation delegates to Integral[T].rem method for the corresponding type T. The default implementation can be overridden for any concrete type T.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fromInt(x: Int): T
Returns a value of type T, which corresponds to the given integer value
x
.Returns a value of type T, which corresponds to the given integer value
x
.- Definition Classes
- ExactNumeric
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
negate(x: T): T
Returns negative value
-x
.Returns negative value
-x
.- Definition Classes
- ExactNumeric
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
lazy val
one: T
A value of type T which corresponds to integer 1.
A value of type T which corresponds to integer 1.
- Definition Classes
- ExactNumeric
-
def
quot(x: T, y: T): T
Integer division operation
x / y
. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toInt(x: T): Int
- Definition Classes
- ExactNumeric
-
def
toLong(x: T): Long
- Definition Classes
- ExactNumeric
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
lazy val
zero: T
A value of type T which corresponds to integer 0.
A value of type T which corresponds to integer 0.
- Definition Classes
- ExactNumeric