Skip to content

module internal.types.intn

Source: stdlib/internal/types/intn.codon


Int[N] @extend Class is extended to add given methods

Magic methods

__new__()

__new__(what: float) @overload Function is overloaded

__new__(what: Int[M], M: Literal[int]) @overload Function is overloaded

__new__(what: UInt[M], M: Literal[int]) @overload Function is overloaded

__new__(what: UInt[N]) @overload Function is overloaded

__new__(what: int) @overload Function is overloaded

__new__(what: str) @overload Function is overloaded

__int__(self)

__index__(self)

__copy__(self)

__deepcopy__(self)

__hash__(self)

__float__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = sitofp i{=N} %self to double
ret double %0

__bool__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp ne i{=N} %self, 0
%1 = zext i1 %0 to i8
ret i8 %1

__pos__(self)

__neg__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = sub i{=N} 0, %self
ret i{=N} %0

__invert__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = xor i{=N} %self, -1
ret i{=N} %0

__abs__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

declare i{=N} @llvm.abs.i{=N}(i{=N}, i1)
%0 = call i{=N} @llvm.abs.i{=N}(i{=N} %self, i1 false)
ret i{=N} %0

__add__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @llvm Function is implemented with inline LLVM IR

%0 = add i{=N} %self, %other
ret i{=N} %0

__sub__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = sub i{=N} %self, %other
ret i{=N} %0

__mul__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @distributive Binary operator is distributive @llvm Function is implemented with inline LLVM IR

%0 = mul i{=N} %self, %other
ret i{=N} %0

__floordiv__(self, other: Int[N])

__truediv__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = sitofp i{=N} %self to double
%1 = sitofp i{=N} %other to double
%2 = fdiv double %0, %1
ret double %2

__mod__(self, other: Int[N])

__divmod__(self, other: Int[N])

__lshift__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = shl i{=N} %self, %other
ret i{=N} %0

__rshift__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = ashr i{=N} %self, %other
ret i{=N} %0

__eq__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp eq i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__ne__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp ne i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__lt__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp slt i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__gt__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp sgt i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__le__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp sle i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__ge__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp sge i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__and__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @llvm Function is implemented with inline LLVM IR

%0 = and i{=N} %self, %other
ret i{=N} %0

__or__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @llvm Function is implemented with inline LLVM IR

%0 = or i{=N} %self, %other
ret i{=N} %0

__xor__(self, other: Int[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @llvm Function is implemented with inline LLVM IR

%0 = xor i{=N} %self, %other
ret i{=N} %0

__pow__(self, exp: Int[N])

__repr__(self)

Methods

popcnt(self)

len()


UInt[N] @extend Class is extended to add given methods

Magic methods

__new__()

__new__(what: UInt[N]) @overload Function is overloaded

__new__(what: float) @overload Function is overloaded

__new__(what: UInt[M], M: Literal[int]) @overload Function is overloaded

__new__(what: Int[M], M: Literal[int]) @overload Function is overloaded

__new__(what: Int[N]) @overload Function is overloaded

__new__(what: Int[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

ret i{=N} %what

__new__(what: int)

__new__(what: str)

__int__(self)

__index__(self)

__copy__(self)

__deepcopy__(self)

__hash__(self)

__float__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = uitofp i{=N} %self to double
ret double %0

__bool__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp ne i{=N} %self, 0
%1 = zext i1 %0 to i8
ret i8 %1

__pos__(self)

__neg__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = sub i{=N} 0, %self
ret i{=N} %0

__invert__(self) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = xor i{=N} %self, -1
ret i{=N} %0

__abs__(self)

__add__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @llvm Function is implemented with inline LLVM IR

%0 = add i{=N} %self, %other
ret i{=N} %0

__sub__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = sub i{=N} %self, %other
ret i{=N} %0

__mul__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @distributive Binary operator is distributive @llvm Function is implemented with inline LLVM IR

%0 = mul i{=N} %self, %other
ret i{=N} %0

__floordiv__(self, other: UInt[N])

__truediv__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = uitofp i{=N} %self to double
%1 = uitofp i{=N} %other to double
%2 = fdiv double %0, %1
ret double %2

__mod__(self, other: UInt[N])

__divmod__(self, other: UInt[N])

__lshift__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = shl i{=N} %self, %other
ret i{=N} %0

__rshift__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = lshr i{=N} %self, %other
ret i{=N} %0

__eq__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp eq i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__ne__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp ne i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__lt__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp ult i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__gt__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp ugt i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__le__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp ule i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__ge__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @llvm Function is implemented with inline LLVM IR

%0 = icmp uge i{=N} %self, %other
%1 = zext i1 %0 to i8
ret i8 %1

__and__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @llvm Function is implemented with inline LLVM IR

%0 = and i{=N} %self, %other
ret i{=N} %0

__or__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @llvm Function is implemented with inline LLVM IR

%0 = or i{=N} %self, %other
ret i{=N} %0

__xor__(self, other: UInt[N]) @pure Function has no side effects and returns same value for same inputs @commutative Binary operator is commutative @associative Binary operator is associative @llvm Function is implemented with inline LLVM IR

%0 = xor i{=N} %self, %other
ret i{=N} %0

__pow__(self, exp: UInt[N])

__repr__(self)

Methods

popcnt(self)

len()


i1 = Int[1]


i8 = Int[8]


i16 = Int[16]


i32 = Int[32]


i64 = Int[64]


i128 = Int[128]


u1 = UInt[1]


u8 = UInt[8]


u16 = UInt[16]


u32 = UInt[32]


u64 = UInt[64]


u128 = UInt[128]