long

scala.compiletime.ops.long
object long

Attributes

Source
long.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
long.type

Members list

Type members

Types

type %[X <: Long, Y <: Long] <: Long

Remainder of the division of X by Y.

Remainder of the division of X by Y.

import compiletime.ops.long.*
val mod: 5L % 2L = 1L

Attributes

Source
long.scala
type *[X <: Long, Y <: Long] <: Long

Multiplication of two Long singleton types.

Multiplication of two Long singleton types.

import compiletime.ops.long.*
val mul: 4L * 2L = 8L

Attributes

Source
long.scala
type +[X <: Long, Y <: Long] <: Long

Addition of two Long singleton types.

Addition of two Long singleton types.

import compiletime.ops.long.*
val sum: 2L + 2L = 4L

Attributes

Source
long.scala
type -[X <: Long, Y <: Long] <: Long

Subtraction of two Long singleton types.

Subtraction of two Long singleton types.

import compiletime.ops.long.*
val sub: 4L - 2L = 2L

Attributes

Source
long.scala
type /[X <: Long, Y <: Long] <: Long

Integer division of two Long singleton types.

Integer division of two Long singleton types.

import compiletime.ops.long.*
val div: 5L / 2L = 2L

Attributes

Source
long.scala
type <[X <: Long, Y <: Long] <: Boolean

Less-than comparison of two Long singleton types.

Less-than comparison of two Long singleton types.

import compiletime.ops.long.*
val lt1: 4L < 2L = false
val lt2: 2L < 4L = true

Attributes

Source
long.scala
type <<[X <: Long, Y <: Long] <: Long

Binary left shift of X by Y.

Binary left shift of X by Y.

import compiletime.ops.long.*
val lshift: 1L << 2L = 4L

Attributes

Source
long.scala
type <=[X <: Long, Y <: Long] <: Boolean

Less-or-equal comparison of two Long singleton types.

Less-or-equal comparison of two Long singleton types.

import compiletime.ops.long.*
val lt1: 4L <= 2L = false
val lt2: 2L <= 2L = true

Attributes

Source
long.scala
type >[X <: Long, Y <: Long] <: Boolean

Greater-than comparison of two Long singleton types.

Greater-than comparison of two Long singleton types.

import compiletime.ops.long.*
val gt1: 4L > 2L = true
val gt2: 2L > 2L = false

Attributes

Source
long.scala
type >=[X <: Long, Y <: Long] <: Boolean

Greater-or-equal comparison of two Long singleton types.

Greater-or-equal comparison of two Long singleton types.

import compiletime.ops.long.*
val ge1: 4L >= 2L = true
val ge2: 2L >= 3L = false

Attributes

Source
long.scala
type >>[X <: Long, Y <: Long] <: Long

Binary right shift of X by Y.

Binary right shift of X by Y.

import compiletime.ops.long.*
val rshift: 10L >> 1L = 5L

Attributes

Source
long.scala
type >>>[X <: Long, Y <: Long] <: Long

Binary right shift of X by Y, filling the left with zeros.

Binary right shift of X by Y, filling the left with zeros.

import compiletime.ops.long.*
val rshiftzero: 10L >>> 1L = 5L

Attributes

Source
long.scala
type Abs[X <: Long] <: Long

Absolute value of an Long singleton type.

Absolute value of an Long singleton type.

import compiletime.ops.long.*
val abs: Abs[-1L] = 1L

Attributes

Source
long.scala
type BitwiseAnd[X <: Long, Y <: Long] <: Long

Bitwise and of X and Y.

Bitwise and of X and Y.

import compiletime.ops.long.*
val and1: BitwiseAnd[4L, 4L] = 4L
val and2: BitwiseAnd[10L, 5L] = 0L

Attributes

Source
long.scala
type BitwiseOr[X <: Long, Y <: Long] <: Long

Bitwise or of X and Y.

Bitwise or of X and Y.

import compiletime.ops.long.*
val or: BitwiseOr[10L, 11L] = 11L

Attributes

Source
long.scala
type Max[X <: Long, Y <: Long] <: Long

Maximum of two Long singleton types.

Maximum of two Long singleton types.

import compiletime.ops.long.*
val max: Max[-1L, 1L] = 1L

Attributes

Source
long.scala
type Min[X <: Long, Y <: Long] <: Long

Minimum of two Long singleton types.

Minimum of two Long singleton types.

import compiletime.ops.long.*
val min: Min[-1L, 1L] = -1L

Attributes

Source
long.scala
type Negate[X <: Long] <: Long

Negation of an Long singleton type.

Negation of an Long singleton type.

import compiletime.ops.long.*
val neg1: Negate[-1L] = 1L
val neg2: Negate[1L] = -1L

Attributes

Source
long.scala
type NumberOfLeadingZeros[X <: Long] <: Int

Number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified Long singleton type. Returns 64 if the specified singleton type has no one-bits in its two's complement representation, in other words if it is equal to zero.

Number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified Long singleton type. Returns 64 if the specified singleton type has no one-bits in its two's complement representation, in other words if it is equal to zero.

import compiletime.ops.long.*
val zero_lzc: NumberOfLeadingZeros[0L] = 64
val eight_lzc: NumberOfLeadingZeros[8L] = 60
type Log2[N <: Long] = int.-[63, NumberOfLeadingZeros[N]]
val log2of8: Log2[8L] = 3

Attributes

Source
long.scala
type S[N <: Long] <: Long

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 <: Long] <: Long = N match {
  case 0L => 1L
  case 1L => 2L
  case 2L => 3L
  // ...
  case 9223372036854775806L => 9223372036854775807L
}

Attributes

Source
long.scala
type ToDouble[X <: Long] <: Double

Double conversion of a Long singleton type.

Double conversion of a Long singleton type.

import compiletime.ops.long.*
val x: ToDouble[1L] = 1.0

Attributes

Source
long.scala
type ToFloat[X <: Long] <: Float

Float conversion of a Long singleton type.

Float conversion of a Long singleton type.

import compiletime.ops.long.*
val x: ToFloat[1L] = 1.0f

Attributes

Source
long.scala
type ToInt[X <: Long] <: Int

Int conversion of a Long singleton type.

Int conversion of a Long singleton type.

import compiletime.ops.long.*
val x: ToInt[1L] = 1

Attributes

Source
long.scala
type ^[X <: Long, Y <: Long] <: Long

Bitwise xor of X and Y.

Bitwise xor of X and Y.

import compiletime.ops.long.*
val xor: 10L ^ 30L = 20L

Attributes

Source
long.scala