int
- Source:
- int.scala
Type members
Types
Remainder of the division of X
by Y
.
Remainder of the division of X
by Y
.
val mod: 5 % 2 = 1
- Source:
- int.scala
Multiplication of two Int
singleton types.
Multiplication of two Int
singleton types.
val mul: 4 * 2 = 8
- Source:
- int.scala
Addition of two Int
singleton types.
Addition of two Int
singleton types.
val sum: 2 + 2 = 4
- Source:
- int.scala
Subtraction of two Int
singleton types.
Subtraction of two Int
singleton types.
val sub: 4 - 2 = 2
- Source:
- int.scala
Integer division of two Int
singleton types.
Integer division of two Int
singleton types.
val div: 5 / 2 = 2
- Source:
- int.scala
Less-than comparison of two Int
singleton types.
Less-than comparison of two Int
singleton types.
val lt1: 4 < 2 = false
val lt2: 2 < 4 = true
- Source:
- int.scala
Less-or-equal comparison of two Int
singleton types.
Less-or-equal comparison of two Int
singleton types.
val lt1: 4 <= 2 = false
val lt2: 2 <= 2 = true
- Source:
- int.scala
Greater-than comparison of two Int
singleton types.
Greater-than comparison of two Int
singleton types.
val gt1: 4 > 2 = true
val gt2: 2 > 2 = false
- Source:
- int.scala
Greater-or-equal comparison of two Int
singleton types.
Greater-or-equal comparison of two Int
singleton types.
val ge1: 4 >= 2 = true
val ge2: 2 >= 3 = false
- Source:
- int.scala
Binary right shift of X
by Y
.
Binary right shift of X
by Y
.
val rshift: 10 >> 1 = 5
- Source:
- int.scala
Binary right shift of X
by Y
, filling the left with zeros.
Binary right shift of X
by Y
, filling the left with zeros.
val rshiftzero: 10 >>> 1 = 5
- Source:
- int.scala
Absolute value of an Int
singleton type.
Absolute value of an Int
singleton type.
val abs: Abs[-1] = 1
- Source:
- int.scala
Bitwise and of X
and Y
.
Bitwise and of X
and Y
.
val and1: BitwiseAnd[4, 4] = 4
val and2: BitwiseAnd[10, 5] = 0
- Source:
- int.scala
Maximum of two Int
singleton types.
Maximum of two Int
singleton types.
val max: Max[-1, 1] = 1
- Source:
- int.scala
Minimum of two Int
singleton types.
Minimum of two Int
singleton types.
val min: Min[-1, 1] = -1
- Source:
- int.scala
Negation of an Int
singleton type.
Negation of an Int
singleton type.
val neg1: Neg[-1] = 1
val neg2: Neg[1] = -1
- Source:
- int.scala
Successor of a natural number where zero is the type 0 and successors are reduced as if the definition was
Successor of a natural number where zero is the type 0 and successors are reduced as if the definition was
type S[N <: Int] <: Int = N match {
case 0 => 1
case 1 => 2
case 2 => 3
...
case 2147483646 => 2147483647
}
- Source:
- int.scala
String conversion of an Int
singleton type.
String conversion of an Int
singleton type.
val abs: ToString[1] = "1"
- Source:
- int.scala