Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.compiletime/scala.compiletime.ops/int

int

scala.compiletime.ops.int
objectint

Attributes

Source
int.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
int.type

Members list

Type members

Types

infixtype%[X <:Int,Y <:Int] <:Int

Remainder of the division ofX byY.

Remainder of the division ofX byY.

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

Attributes

Source
int.scala
infixtype*[X <:Int,Y <:Int] <:Int

Multiplication of twoInt singleton types.

Multiplication of twoInt singleton types.

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

Attributes

Source
int.scala
infixtype+[X <:Int,Y <:Int] <:Int

Addition of twoInt singleton types.

Addition of twoInt singleton types.

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

Attributes

Source
int.scala
infixtype-[X <:Int,Y <:Int] <:Int

Subtraction of twoInt singleton types.

Subtraction of twoInt singleton types.

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

Attributes

Source
int.scala
infixtype/[X <:Int,Y <:Int] <:Int

Integer division of twoInt singleton types.

Integer division of twoInt singleton types.

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

Attributes

Source
int.scala
infixtype<[X <:Int,Y <:Int] <:Boolean

Less-than comparison of twoInt singleton types.

Less-than comparison of twoInt singleton types.

import compiletime.ops.int.*val lt1: 4 < 2 = falseval lt2: 2 < 4 = true

Attributes

Source
int.scala
infixtype<<[X <:Int,Y <:Int] <:Int

Binary left shift ofX byY.

Binary left shift ofX byY.

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

Attributes

Source
int.scala
infixtype<=[X <:Int,Y <:Int] <:Boolean

Less-or-equal comparison of twoInt singleton types.

Less-or-equal comparison of twoInt singleton types.

import compiletime.ops.int.*val lt1: 4 <= 2 = falseval lt2: 2 <= 2 = true

Attributes

Source
int.scala
infixtype>[X <:Int,Y <:Int] <:Boolean

Greater-than comparison of twoInt singleton types.

Greater-than comparison of twoInt singleton types.

import compiletime.ops.int.*val gt1: 4 > 2 = trueval gt2: 2 > 2 = false

Attributes

Source
int.scala
infixtype>=[X <:Int,Y <:Int] <:Boolean

Greater-or-equal comparison of twoInt singleton types.

Greater-or-equal comparison of twoInt singleton types.

import compiletime.ops.int.*val ge1: 4 >= 2 = trueval ge2: 2 >= 3 = false

Attributes

Source
int.scala
infixtype>>[X <:Int,Y <:Int] <:Int

Binary right shift ofX byY.

Binary right shift ofX byY.

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

Attributes

Source
int.scala
infixtype>>>[X <:Int,Y <:Int] <:Int

Binary right shift ofX byY, filling the left with zeros.

Binary right shift ofX byY, filling the left with zeros.

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

Attributes

Source
int.scala
typeAbs[X <:Int] <:Int

Absolute value of anInt singleton type.

Absolute value of anInt singleton type.

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

Attributes

Source
int.scala
typeBitwiseAnd[X <:Int,Y <:Int] <:Int

Bitwise and ofX andY.

Bitwise and ofX andY.

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

Attributes

Source
int.scala
typeBitwiseOr[X <:Int,Y <:Int] <:Int

Bitwise or ofX andY.

Bitwise or ofX andY.

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

Attributes

Source
int.scala
typeMax[X <:Int,Y <:Int] <:Int

Maximum of twoInt singleton types.

Maximum of twoInt singleton types.

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

Attributes

Source
int.scala
typeMin[X <:Int,Y <:Int] <:Int

Minimum of twoInt singleton types.

Minimum of twoInt singleton types.

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

Attributes

Source
int.scala
typeNegate[X <:Int] <:Int

Negation of anInt singleton type.

Negation of anInt singleton type.

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

Attributes

Source
int.scala

Number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specifiedInt singleton type. Returns 32 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 specifiedInt singleton type. Returns 32 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.int.*val zero_lzc: NumberOfLeadingZeros[0] = 32val eight_lzc: NumberOfLeadingZeros[8] = 28type Log2[N <: Int] = 31 - NumberOfLeadingZeros[N]val log2of8: Log2[8] = 3

Attributes

Source
int.scala
typeS[N <:Int] <:Int

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:

import compiletime.ops.int.*type S[N <: Int] <: Int = N match {  case 0 => 1  case 1 => 2  case 2 => 3  // ...  case 2147483646 => 2147483647}

Attributes

Source
int.scala
typeToDouble[X <:Int] <:Double

Double conversion of anInt singleton type.

Double conversion of anInt singleton type.

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

Attributes

Source
int.scala
typeToFloat[X <:Int] <:Float

Float conversion of anInt singleton type.

Float conversion of anInt singleton type.

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

Attributes

Source
int.scala
typeToLong[X <:Int] <:Long

Long conversion of anInt singleton type.

Long conversion of anInt singleton type.

import compiletime.ops.int.*val x: ToLong[1] = 1L

Attributes

Source
int.scala
infixtype^[X <:Int,Y <:Int] <:Int

Bitwise xor ofX andY.

Bitwise xor ofX andY.

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

Attributes

Source
int.scala

Deprecated types

typeToString[X <:Int] <:String

String conversion of anInt singleton type.

String conversion of anInt singleton type.

import compiletime.ops.int.*val abs: ToString[1] = "1"

Attributes

Deprecated
[Since version 3.2.0]Use compiletime.ops.any.ToString instead.
Source
int.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp