ints

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 5 Imported by: 1

README

ints

Go Reference Test

The ints package is a package for handling integer types of various sizes that are not included in the built-in types.

SYNOPSIS

import "github.com/shogo82148/bits"

func main() {
  // a and b are 128-bit integer.
  a := bits.Uint64(math.MaxUint64).Uint128()
  b := bits.Uint64(10).Uint128()

  var c ints.Uint128
  c = a.Add(b) // c = a + b
  c = a.Sub(b) // c = a - b
  c = a.Mul(b) // c = a * b
  c = a.Quo(b) // c = a / b
}

Documentation

Overview

ints package handles integer types of various sizes that are not included in the built-in types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Int8

type Int8 int8

Int8 is a type that represents an 8-bit signed integer. It is an alias for the built-in int8 type.

func (Int8) Add

func (a Int8) Add(b Int8) Int8

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Int8) And

func (a Int8) And(b Int8) Int8

And returns the bitwise AND of a and b.

func (Int8) AndNot

func (a Int8) AndNot(b Int8) Int8

AndNot returns the bitwise AND NOT of a and b.

func (Int8) Append

func (a Int8) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Int8) AppendText

func (a Int8) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Int8) Cmp

func (a Int8) Cmp(b Int8) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Int8) Div

func (a Int8) Div(b Int8) Int8

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Int8.DivMod for more details.

func (Int8) DivMod

func (a Int8) DivMod(b Int8) (Int8, Int8)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Int8.QuoRem for T-division and modulus (like Go).

func (Int8) Format

func (a Int8) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Int8) Int8

func (a Int8) Int8() Int8

Int8 returns a itself.

func (Int8) Int16

func (a Int8) Int16() Int16

Int16 converts a to an Int16.

func (Int8) Int32

func (a Int8) Int32() Int32

Int32 converts a to an Int32.

func (Int8) Int64

func (a Int8) Int64() Int64

Int64 converts a to an Int64.

func (Int8) Int128

func (a Int8) Int128() Int128

Int128 converts a to an Int128.

func (Int8) Int256

func (a Int8) Int256() Int256

Int256 converts a to an Int256.

func (Int8) Int512

func (a Int8) Int512() Int512

Int512 converts a to an Int512.

func (Int8) Int1024

func (a Int8) Int1024() Int1024

Int1024 converts a to an Int1024.

func (Int8) IsZero

func (a Int8) IsZero() bool

IsZero returns true if a is zero.

func (Int8) Lsh

func (a Int8) Lsh(i uint) Int8

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Int8) Mod

func (a Int8) Mod(b Int8) Int8

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Int8.DivMod for more details.

func (Int8) Mul

func (a Int8) Mul(b Int8) Int8

Mul returns the product a*b.

This function's execution time does not depend on the inputs.

func (Int8) Neg

func (a Int8) Neg() Int8

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Int8) Not

func (a Int8) Not() Int8

Not returns the bitwise NOT of a.

func (Int8) Or

func (a Int8) Or(b Int8) Int8

Or returns the bitwise OR of a and b.

func (Int8) Quo

func (a Int8) Quo(b Int8) Int8

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Int8.QuoRem for more details.

func (Int8) QuoRem

func (a Int8) QuoRem(b Int8) (Int8, Int8)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Int8.DivMod for Euclidean division and modulus (unlike Go).

func (Int8) Rem

func (a Int8) Rem(b Int8) Int8

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Int8.QuoRem for more details.

func (Int8) Rsh

func (a Int8) Rsh(i uint) Int8

Rsh returns the arithmetic right shift a>>i, preserving the sign bit.

This function's execution time does not depend on the inputs.

func (Int8) Sign

func (a Int8) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, -1 if a < 0, and 0 if a == 0.

func (Int8) String

func (a Int8) String() string

String returns the string representation of a in base 10.

func (Int8) Sub

func (a Int8) Sub(b Int8) Int8

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Int8) Text

func (a Int8) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Int8) Xor

func (a Int8) Xor(b Int8) Int8

Xor returns the bitwise XOR of a and b.

type Int16

type Int16 int16

Int16 is a type that represents an 16-bit signed integer. It is an alias for the built-in int16 type.

func (Int16) Add

func (a Int16) Add(b Int16) Int16

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Int16) And

func (a Int16) And(b Int16) Int16

And returns the bitwise AND of a and b.

func (Int16) AndNot

func (a Int16) AndNot(b Int16) Int16

AndNot returns the bitwise AND NOT of a and b.

func (Int16) Append

func (a Int16) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Int16) AppendText

func (a Int16) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Int16) Cmp

func (a Int16) Cmp(b Int16) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Int16) Div

func (a Int16) Div(b Int16) Int16

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Int16.DivMod for more details.

func (Int16) DivMod

func (a Int16) DivMod(b Int16) (Int16, Int16)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Int16.QuoRem for T-division and modulus (like Go).

func (Int16) Format

func (a Int16) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Int16) Int8

func (a Int16) Int8() Int8

Int8 converts a to an Int8.

func (Int16) Int16

func (a Int16) Int16() Int16

Int16 returns a itself.

func (Int16) Int32

func (a Int16) Int32() Int32

Int32 converts a to an Int32.

func (Int16) Int64

func (a Int16) Int64() Int64

Int64 converts a to an Int64.

func (Int16) Int128

func (a Int16) Int128() Int128

Int128 converts a to an Int128.

func (Int16) Int256

func (a Int16) Int256() Int256

Int256 converts a to an Int256.

func (Int16) Int512

func (a Int16) Int512() Int512

Int512 converts a to an Int512.

func (Int16) Int1024

func (a Int16) Int1024() Int1024

Int1024 converts a to an Int1024.

func (Int16) IsZero

func (a Int16) IsZero() bool

IsZero returns true if a is zero.

func (Int16) Lsh

func (a Int16) Lsh(i uint) Int16

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Int16) Mod

func (a Int16) Mod(b Int16) Int16

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Int16.DivMod for more details.

func (Int16) Mul

func (a Int16) Mul(b Int16) Int16

Mul returns the product a*b.

This function's execution time does not depend on the inputs.

func (Int16) Neg

func (a Int16) Neg() Int16

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Int16) Not

func (a Int16) Not() Int16

Not returns the bitwise NOT of a.

func (Int16) Or

func (a Int16) Or(b Int16) Int16

Or returns the bitwise OR of a and b.

func (Int16) Quo

func (a Int16) Quo(b Int16) Int16

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Int16.QuoRem for more details.

func (Int16) QuoRem

func (a Int16) QuoRem(b Int16) (Int16, Int16)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Int16.DivMod for Euclidean division and modulus (unlike Go).

func (Int16) Rem

func (a Int16) Rem(b Int16) Int16

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Int16.QuoRem for more details.

func (Int16) Rsh

func (a Int16) Rsh(i uint) Int16

Rsh returns the arithmetic right shift a>>i, preserving the sign bit.

This function's execution time does not depend on the inputs.

func (Int16) Sign

func (a Int16) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, -1 if a < 0, and 0 if a == 0.

func (Int16) String

func (a Int16) String() string

String returns the string representation of a in base 10.

func (Int16) Sub

func (a Int16) Sub(b Int16) Int16

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Int16) Text

func (a Int16) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Int16) Xor

func (a Int16) Xor(b Int16) Int16

Xor returns the bitwise XOR of a and b.

type Int32

type Int32 int32

Int32 is a type that represents an 32-bit signed integer. It is an alias for the built-in int32 type.

func (Int32) Add

func (a Int32) Add(b Int32) Int32

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Int32) And

func (a Int32) And(b Int32) Int32

And returns the bitwise AND of a and b.

func (Int32) AndNot

func (a Int32) AndNot(b Int32) Int32

AndNot returns the bitwise AND NOT of a and b.

func (Int32) Append

func (a Int32) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Int32) AppendText

func (a Int32) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Int32) Cmp

func (a Int32) Cmp(b Int32) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Int32) Div

func (a Int32) Div(b Int32) Int32

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Int32.DivMod for more details.

func (Int32) DivMod

func (a Int32) DivMod(b Int32) (Int32, Int32)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Int32.QuoRem for T-division and modulus (like Go).

func (Int32) Format

func (a Int32) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Int32) Int8

func (a Int32) Int8() Int8

Int8 converts a to an Int8.

func (Int32) Int16

func (a Int32) Int16() Int16

Int16 converts a to an Int16.

func (Int32) Int32

func (a Int32) Int32() Int32

Int32 returns a itself.

func (Int32) Int64

func (a Int32) Int64() Int64

Int64 converts a to an Int64.

func (Int32) Int128

func (a Int32) Int128() Int128

Int128 converts a to an Int128.

func (Int32) Int256

func (a Int32) Int256() Int256

Int256 converts a to an Int256.

func (Int32) Int512

func (a Int32) Int512() Int512

Int512 converts a to an Int512.

func (Int32) Int1024

func (a Int32) Int1024() Int1024

Int1024 converts a to an Int1024.

func (Int32) IsZero

func (a Int32) IsZero() bool

IsZero returns true if a is zero.

func (Int32) Lsh

func (a Int32) Lsh(i uint) Int32

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Int32) Mod

func (a Int32) Mod(b Int32) Int32

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Int32.DivMod for more details.

func (Int32) Mul

func (a Int32) Mul(b Int32) Int32

Mul returns the product a*b.

This function's execution time does not depend on the inputs.

func (Int32) Neg

func (a Int32) Neg() Int32

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Int32) Not

func (a Int32) Not() Int32

Not returns the bitwise NOT of a.

func (Int32) Or

func (a Int32) Or(b Int32) Int32

Or returns the bitwise OR of a and b.

func (Int32) Quo

func (a Int32) Quo(b Int32) Int32

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Int32.QuoRem for more details.

func (Int32) QuoRem

func (a Int32) QuoRem(b Int32) (Int32, Int32)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Int32.DivMod for Euclidean division and modulus (unlike Go).

func (Int32) Rem

func (a Int32) Rem(b Int32) Int32

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Int32.QuoRem for more details.

func (Int32) Rsh

func (a Int32) Rsh(i uint) Int32

Rsh returns the arithmetic right shift a>>i, preserving the sign bit.

This function's execution time does not depend on the inputs.

func (Int32) Sign

func (a Int32) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, -1 if a < 0, and 0 if a == 0.

func (Int32) String

func (a Int32) String() string

String returns the string representation of a in base 10.

func (Int32) Sub

func (a Int32) Sub(b Int32) Int32

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Int32) Text

func (a Int32) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Int32) Xor

func (a Int32) Xor(b Int32) Int32

Xor returns the bitwise XOR of a and b.

type Int64

type Int64 int64

Int64 is a type that represents an 64-bit signed integer. It is an alias for the built-in int64 type.

func (Int64) Add

func (a Int64) Add(b Int64) Int64

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Int64) And

func (a Int64) And(b Int64) Int64

And returns the bitwise AND of a and b.

func (Int64) AndNot

func (a Int64) AndNot(b Int64) Int64

AndNot returns the bitwise AND NOT of a and b.

func (Int64) Append

func (a Int64) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Int64) AppendText

func (a Int64) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Int64) Cmp

func (a Int64) Cmp(b Int64) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Int64) Div

func (a Int64) Div(b Int64) Int64

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Int64.DivMod for more details.

func (Int64) DivMod

func (a Int64) DivMod(b Int64) (Int64, Int64)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Int64.QuoRem for T-division and modulus (like Go).

func (Int64) Format

func (a Int64) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Int64) Int8

func (a Int64) Int8() Int8

Int8 converts a to an Int8.

func (Int64) Int16

func (a Int64) Int16() Int16

Int16 converts a to an Int16.

func (Int64) Int32

func (a Int64) Int32() Int32

Int32 converts a to an Int32.

func (Int64) Int64

func (a Int64) Int64() Int64

Int64 returns a itself.

func (Int64) Int128

func (a Int64) Int128() Int128

Int128 converts a to an Int128.

func (Int64) Int256

func (a Int64) Int256() Int256

Int256 converts a to an Int256.

func (Int64) Int512

func (a Int64) Int512() Int512

Int512 converts a to an Int512.

func (Int64) Int1024

func (a Int64) Int1024() Int1024

Int1024 converts a to an Int1024.

func (Int64) IsZero

func (a Int64) IsZero() bool

IsZero returns true if a is zero.

func (Int64) Lsh

func (a Int64) Lsh(i uint) Int64

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Int64) Mod

func (a Int64) Mod(b Int64) Int64

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Int64.DivMod for more details.

func (Int64) Mul

func (a Int64) Mul(b Int64) Int64

Mul returns the product a*b.

This function's execution time does not depend on the inputs.

func (Int64) Neg

func (a Int64) Neg() Int64

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Int64) Not

func (a Int64) Not() Int64

Not returns the bitwise NOT of a.

func (Int64) Or

func (a Int64) Or(b Int64) Int64

Or returns the bitwise OR of a and b.

func (Int64) Quo

func (a Int64) Quo(b Int64) Int64

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Int64.QuoRem for more details.

func (Int64) QuoRem

func (a Int64) QuoRem(b Int64) (Int64, Int64)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Int64.DivMod for Euclidean division and modulus (unlike Go).

func (Int64) Rem

func (a Int64) Rem(b Int64) Int64

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Int64.QuoRem for more details.

func (Int64) Rsh

func (a Int64) Rsh(i uint) Int64

Rsh returns the arithmetic right shift a>>i, preserving the sign bit.

This function's execution time does not depend on the inputs.

func (Int64) Sign

func (a Int64) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, -1 if a < 0, and 0 if a == 0.

func (Int64) String

func (a Int64) String() string

String returns the string representation of a in base 10.

func (Int64) Sub

func (a Int64) Sub(b Int64) Int64

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Int64) Text

func (a Int64) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Int64) Xor

func (a Int64) Xor(b Int64) Int64

Xor returns the bitwise XOR of a and b.

type Int128

type Int128 [2]uint64

Int128 is a type that represents an 128-bit signed integer.

func (Int128) Add

func (a Int128) Add(b Int128) Int128

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Int128) And

func (a Int128) And(b Int128) Int128

And returns the bitwise AND of a and b.

func (Int128) AndNot

func (a Int128) AndNot(b Int128) Int128

AndNot returns the bitwise AND NOT of a and b.

func (Int128) Append

func (a Int128) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Int128) AppendText

func (a Int128) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Int128) Cmp

func (a Int128) Cmp(b Int128) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Int128) Div

func (a Int128) Div(b Int128) Int128

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Int128.DivMod for more details.

func (Int128) DivMod

func (a Int128) DivMod(b Int128) (Int128, Int128)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Int128.QuoRem for T-division and modulus (like Go).

func (Int128) Format

func (a Int128) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Int128) Int8

func (a Int128) Int8() Int8

Int8 converts a to an Int8.

func (Int128) Int16

func (a Int128) Int16() Int16

Int16 converts a to an Int16.

func (Int128) Int32

func (a Int128) Int32() Int32

Int32 converts a to an Int32.

func (Int128) Int64

func (a Int128) Int64() Int64

Int64 converts a to an Int64.

func (Int128) Int128

func (a Int128) Int128() Int128

Int128 returns a itself.

func (Int128) Int256

func (a Int128) Int256() Int256

Int256 converts a to an Int256.

func (Int128) Int512

func (a Int128) Int512() Int512

Int512 converts a to an Int512.

func (Int128) Int1024

func (a Int128) Int1024() Int1024

Int1024 converts a to an Int1024.

func (Int128) IsZero

func (a Int128) IsZero() bool

IsZero returns true if a is zero.

func (Int128) Lsh

func (a Int128) Lsh(i uint) Int128

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Int128) Mod

func (a Int128) Mod(b Int128) Int128

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Int128.DivMod for more details.

func (Int128) Mul

func (a Int128) Mul(b Int128) Int128

Mul returns the product a*b.

func (Int128) Neg

func (a Int128) Neg() Int128

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Int128) Not

func (a Int128) Not() Int128

Not returns the bitwise NOT of a.

func (Int128) Or

func (a Int128) Or(b Int128) Int128

Or returns the bitwise OR of a and b.

func (Int128) Quo

func (a Int128) Quo(b Int128) Int128

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Int128.QuoRem for more details.

func (Int128) QuoRem

func (a Int128) QuoRem(b Int128) (Int128, Int128)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Int128.DivMod for Euclidean division and modulus (unlike Go).

func (Int128) Rem

func (a Int128) Rem(b Int128) Int128

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Int128.QuoRem for more details.

func (Int128) Rsh

func (a Int128) Rsh(i uint) Int128

Rsh returns the arithmetic right shift a>>i, preserving the sign bit.

This function's execution time does not depend on the inputs.

func (Int128) Sign

func (a Int128) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, -1 if a < 0, and 0 if a == 0.

func (Int128) String

func (a Int128) String() string

String returns the string representation of a in base 10.

func (Int128) Sub

func (a Int128) Sub(b Int128) Int128

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Int128) Text

func (a Int128) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Int128) Xor

func (a Int128) Xor(b Int128) Int128

Xor returns the bitwise XOR of a and b.

type Int256

type Int256 [4]uint64

Int256 is a type that represents an 256-bit signed integer.

func (Int256) Add

func (a Int256) Add(b Int256) Int256

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Int256) And

func (a Int256) And(b Int256) Int256

And returns the bitwise AND of a and b.

func (Int256) AndNot

func (a Int256) AndNot(b Int256) Int256

AndNot returns the bitwise AND NOT of a and b.

func (Int256) Append

func (a Int256) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Int256) AppendText

func (a Int256) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Int256) Cmp

func (a Int256) Cmp(b Int256) int

func (Int256) Div

func (a Int256) Div(b Int256) Int256

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Int256.DivMod for more details.

func (Int256) DivMod

func (a Int256) DivMod(b Int256) (Int256, Int256)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Int256.QuoRem for T-division and modulus (like Go).

func (Int256) Format

func (a Int256) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Int256) Int8

func (a Int256) Int8() Int8

Int8 converts a to an Int8.

func (Int256) Int16

func (a Int256) Int16() Int16

Int16 converts a to an Int16.

func (Int256) Int32

func (a Int256) Int32() Int32

Int32 converts a to an Int32.

func (Int256) Int64

func (a Int256) Int64() Int64

Int64 converts a to an Int64.

func (Int256) Int128

func (a Int256) Int128() Int128

Int128 converts a to an Int128.

func (Int256) Int256

func (a Int256) Int256() Int256

Int256 returns a itself.

func (Int256) Int512

func (a Int256) Int512() Int512

Int512 converts a to an Int512.

func (Int256) Int1024

func (a Int256) Int1024() Int1024

Int1024 converts a to an Int1024.

func (Int256) IsZero

func (a Int256) IsZero() bool

IsZero returns true if a is zero.

func (Int256) Lsh

func (a Int256) Lsh(i uint) Int256

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Int256) Mod

func (a Int256) Mod(b Int256) Int256

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Int256.DivMod for more details.

func (Int256) Mul

func (a Int256) Mul(b Int256) Int256

Mul returns the product a*b.

func (Int256) Neg

func (a Int256) Neg() Int256

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Int256) Not

func (a Int256) Not() Int256

Not returns the bitwise NOT of a.

func (Int256) Or

func (a Int256) Or(b Int256) Int256

Or returns the bitwise OR of a and b.

func (Int256) Quo

func (a Int256) Quo(b Int256) Int256

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Int256.QuoRem for more details.

func (Int256) QuoRem

func (a Int256) QuoRem(b Int256) (Int256, Int256)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Int256.DivMod for Euclidean division and modulus (unlike Go).

func (Int256) Rem

func (a Int256) Rem(b Int256) Int256

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Int256.QuoRem for more details.

func (Int256) Rsh

func (a Int256) Rsh(i uint) Int256

Rsh returns the arithmetic right shift a>>i, preserving the sign bit.

This function's execution time does not depend on the inputs.

func (Int256) Sign

func (a Int256) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, -1 if a < 0, and 0 if a == 0.

func (Int256) String

func (a Int256) String() string

String returns the string representation of a in base 10.

func (Int256) Sub

func (a Int256) Sub(b Int256) Int256

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Int256) Text

func (a Int256) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Int256) Xor

func (a Int256) Xor(b Int256) Int256

Xor returns the bitwise XOR of a and b.

type Int512

type Int512 [8]uint64

Int512 is a type that represents an 512-bit signed integer.

func (Int512) Add

func (a Int512) Add(b Int512) Int512

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Int512) And

func (a Int512) And(b Int512) Int512

And returns the bitwise AND of a and b.

func (Int512) AndNot

func (a Int512) AndNot(b Int512) Int512

AndNot returns the bitwise AND NOT of a and b.

func (Int512) Append

func (a Int512) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Int512) AppendText

func (a Int512) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Int512) Cmp

func (a Int512) Cmp(b Int512) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Int512) Div

func (a Int512) Div(b Int512) Int512

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Int512.DivMod for more details.

func (Int512) DivMod

func (a Int512) DivMod(b Int512) (Int512, Int512)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Int512.QuoRem for T-division and modulus (like Go).

func (Int512) Format

func (a Int512) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Int512) Int8

func (a Int512) Int8() Int8

Int8 converts a to an Int8.

func (Int512) Int16

func (a Int512) Int16() Int16

Int16 converts a to an Int16.

func (Int512) Int32

func (a Int512) Int32() Int32

Int32 converts a to an Int32.

func (Int512) Int64

func (a Int512) Int64() Int64

Int64 converts a to an Int64.

func (Int512) Int128

func (a Int512) Int128() Int128

Int128 converts a to an Int128.

func (Int512) Int256

func (a Int512) Int256() Int256

Int256 converts a to an Int256.

func (Int512) Int512

func (a Int512) Int512() Int512

Int512 returns a itself.

func (Int512) Int1024

func (a Int512) Int1024() Int1024

Int1024 converts a to an Int1024.

func (Int512) IsZero

func (a Int512) IsZero() bool

IsZero returns true if a is zero.

func (Int512) Lsh

func (a Int512) Lsh(i uint) Int512

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Int512) Mod

func (a Int512) Mod(b Int512) Int512

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Int512.DivMod for more details.

func (Int512) Mul

func (a Int512) Mul(b Int512) Int512

Mul returns the product a*b.

func (Int512) Neg

func (a Int512) Neg() Int512

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Int512) Not

func (a Int512) Not() Int512

Not returns the bitwise NOT of a.

func (Int512) Or

func (a Int512) Or(b Int512) Int512

Or returns the bitwise OR of a and b.

func (Int512) Quo

func (a Int512) Quo(b Int512) Int512

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Int512.QuoRem for more details.

func (Int512) QuoRem

func (a Int512) QuoRem(b Int512) (Int512, Int512)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Int512.DivMod for Euclidean division and modulus (unlike Go).

func (Int512) Rem

func (a Int512) Rem(b Int512) Int512

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Int512.QuoRem for more details.

func (Int512) Rsh

func (a Int512) Rsh(i uint) Int512

Rsh returns the arithmetic right shift a>>i, preserving the sign bit.

This function's execution time does not depend on the inputs.

func (Int512) Sign

func (a Int512) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, -1 if a < 0, and 0 if a == 0.

func (Int512) String

func (a Int512) String() string

String returns the string representation of a in base 10.

func (Int512) Sub

func (a Int512) Sub(b Int512) Int512

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Int512) Text

func (a Int512) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Int512) Xor

func (a Int512) Xor(b Int512) Int512

Xor returns the bitwise XOR of a and b.

type Int1024

type Int1024 [16]uint64

Int1024 is a type that represents an 1024-bit signed integer.

func (Int1024) Add

func (a Int1024) Add(b Int1024) Int1024

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Int1024) And

func (a Int1024) And(b Int1024) Int1024

And returns the bitwise AND of a and b.

func (Int1024) AndNot

func (a Int1024) AndNot(b Int1024) Int1024

AndNot returns the bitwise AND NOT of a and b.

func (Int1024) Append

func (a Int1024) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Int1024) AppendText

func (a Int1024) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Int1024) Cmp

func (a Int1024) Cmp(b Int1024) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Int1024) Div

func (a Int1024) Div(b Int1024) Int1024

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Int1024.DivMod for more details.

func (Int1024) DivMod

func (a Int1024) DivMod(b Int1024) (Int1024, Int1024)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Int1024.QuoRem for T-division and modulus (like Go).

func (Int1024) Format

func (a Int1024) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Int1024) Int8

func (a Int1024) Int8() Int8

Int8 converts a to an Int8.

func (Int1024) Int16

func (a Int1024) Int16() Int16

Int16 converts a to an Int16.

func (Int1024) Int32

func (a Int1024) Int32() Int32

Int32 converts a to an Int32.

func (Int1024) Int64

func (a Int1024) Int64() Int64

Int64 converts a to an Int64.

func (Int1024) Int128

func (a Int1024) Int128() Int128

Int128 converts a to an Int128.

func (Int1024) Int256

func (a Int1024) Int256() Int256

Int256 converts a to an Int256.

func (Int1024) Int512

func (a Int1024) Int512() Int512

Int512 converts a to an Int512.

func (Int1024) Int1024

func (a Int1024) Int1024() Int1024

Int1024 returns a itself.

func (Int1024) IsZero

func (a Int1024) IsZero() bool

IsZero returns true if a is zero.

func (Int1024) Lsh

func (a Int1024) Lsh(i uint) Int1024

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Int1024) Mod

func (a Int1024) Mod(b Int1024) Int1024

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Int1024.DivMod for more details.

func (Int1024) Mul

func (a Int1024) Mul(b Int1024) Int1024

Mul returns the product a*b.

func (Int1024) Neg

func (a Int1024) Neg() Int1024

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Int1024) Not

func (a Int1024) Not() Int1024

Not returns the bitwise NOT of a.

func (Int1024) Or

func (a Int1024) Or(b Int1024) Int1024

Or returns the bitwise OR of a and b.

func (Int1024) Quo

func (a Int1024) Quo(b Int1024) Int1024

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Int1024.QuoRem for more details.

func (Int1024) QuoRem

func (a Int1024) QuoRem(b Int1024) (Int1024, Int1024)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Int1024.DivMod for Euclidean division and modulus (unlike Go).

func (Int1024) Rem

func (a Int1024) Rem(b Int1024) Int1024

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Int1024.QuoRem for more details.

func (Int1024) Rsh

func (a Int1024) Rsh(i uint) Int1024

Rsh returns the arithmetic right shift a>>i, preserving the sign bit.

This function's execution time does not depend on the inputs.

func (Int1024) Sign

func (a Int1024) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, -1 if a < 0, and 0 if a == 0.

func (Int1024) String

func (a Int1024) String() string

String returns the string representation of a in base 10.

func (Int1024) Sub

func (a Int1024) Sub(b Int1024) Int1024

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Int1024) Text

func (a Int1024) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Int1024) Xor

func (a Int1024) Xor(b Int1024) Int1024

Xor returns the bitwise XOR of a and b.

type Uint8

type Uint8 uint8

Uint8 is a type that represents an 8-bit unsigned integer. It is an alias for the built-in uint8 type.

func (Uint8) Add

func (a Uint8) Add(b Uint8) Uint8

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Uint8) And

func (a Uint8) And(b Uint8) Uint8

And returns the bitwise AND of a and b.

func (Uint8) AndNot

func (a Uint8) AndNot(b Uint8) Uint8

AndNot returns the bitwise AND NOT of a and b.

func (Uint8) Append

func (a Uint8) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Uint8) AppendText

func (a Uint8) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Uint8) BitLen

func (a Uint8) BitLen() int

BitLen returns the number of bits required to represent a in binary; the result is 0 for a == 0.

func (Uint8) Cmp

func (a Uint8) Cmp(b Uint8) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Uint8) Div

func (a Uint8) Div(b Uint8) Uint8

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Uint8.DivMod for more details.

func (Uint8) DivMod

func (a Uint8) DivMod(b Uint8) (Uint8, Uint8)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Uint8.QuoRem for T-division and modulus (like Go).

func (Uint8) Format

func (a Uint8) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Uint8) IsZero

func (a Uint8) IsZero() bool

IsZero returns true if a is zero.

func (Uint8) LeadingZeros

func (a Uint8) LeadingZeros() int

LeadingZeros returns the number of leading zero bits in a; the result is 8 for a == 0.

func (Uint8) Lsh

func (a Uint8) Lsh(i uint) Uint8

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Uint8) Mod

func (a Uint8) Mod(b Uint8) Uint8

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Uint8.DivMod for more details.

func (Uint8) Mul

func (a Uint8) Mul(b Uint8) Uint8

Mul returns the product a*b.

func (Uint8) Mul16

func (a Uint8) Mul16(b Uint8) Uint16

Mul16 returns the product a*b, the result is a 16-bit integer.

func (Uint8) Neg

func (a Uint8) Neg() Uint8

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Uint8) Not

func (a Uint8) Not() Uint8

Not returns the bitwise NOT of a.

func (Uint8) Or

func (a Uint8) Or(b Uint8) Uint8

Or returns the bitwise OR of a and b.

func (Uint8) Quo

func (a Uint8) Quo(b Uint8) Uint8

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Uint8.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Quo simply forwards to Div.

func (Uint8) QuoRem

func (a Uint8) QuoRem(b Uint8) (Uint8, Uint8)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Uint8.DivMod for Euclidean division and modulus (unlike Go). For unsigned integers T‑division and Euclidean division are identical, therefore QuoRem simply forwards to DivMod.

func (Uint8) Rem

func (a Uint8) Rem(b Uint8) Uint8

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Uint8.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Rem simply forwards to Mod.

func (Uint8) Rsh

func (a Uint8) Rsh(i uint) Uint8

Rsh returns the logical right shift a>>i.

This function's execution time does not depend on the inputs.

func (Uint8) Sign

func (a Uint8) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, and 0 if a == 0. It does not return -1 because Uint8 is unsigned.

func (Uint8) String

func (a Uint8) String() string

String returns the string representation of a in base 10.

func (Uint8) Sub

func (a Uint8) Sub(b Uint8) Uint8

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Uint8) Text

func (a Uint8) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Uint8) TrailingZeros

func (a Uint8) TrailingZeros() int

TrailingZeros returns the number of trailing zero bits in a; the result is 8 for a == 0.

func (Uint8) Uint8

func (a Uint8) Uint8() Uint8

Uint8 returns a itself.

func (Uint8) Uint16

func (a Uint8) Uint16() Uint16

Uint16 converts a to an Uint16.

func (Uint8) Uint32

func (a Uint8) Uint32() Uint32

Uint32 converts a to an Uint32.

func (Uint8) Uint64

func (a Uint8) Uint64() Uint64

Uint64 converts a to an Uint64.

func (Uint8) Uint128

func (a Uint8) Uint128() Uint128

Uint128 converts a to an Uint128.

func (Uint8) Uint256

func (a Uint8) Uint256() Uint256

Uint256 converts a to an Uint256.

func (Uint8) Uint512

func (a Uint8) Uint512() Uint512

Uint512 converts a to an Uint512.

func (Uint8) Uint1024

func (a Uint8) Uint1024() Uint1024

Uint1024 converts a to an Uint1024.

func (Uint8) Xor

func (a Uint8) Xor(b Uint8) Uint8

Xor returns the bitwise XOR of a and b.

type Uint16

type Uint16 uint16

Uint16 is a type that represents an 16-bit unsigned integer. It is an alias for the built-in uint16 type.

func (Uint16) Add

func (a Uint16) Add(b Uint16) Uint16

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Uint16) And

func (a Uint16) And(b Uint16) Uint16

And returns the bitwise AND of a and b.

func (Uint16) AndNot

func (a Uint16) AndNot(b Uint16) Uint16

AndNot returns the bitwise AND NOT of a and b.

func (Uint16) Append

func (a Uint16) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Uint16) AppendText

func (a Uint16) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Uint16) BitLen

func (a Uint16) BitLen() int

BitLen returns the number of bits required to represent a in binary; the result is 0 for a == 0.

func (Uint16) Cmp

func (a Uint16) Cmp(b Uint16) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Uint16) Div

func (a Uint16) Div(b Uint16) Uint16

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Uint16.DivMod for more details.

func (Uint16) DivMod

func (a Uint16) DivMod(b Uint16) (Uint16, Uint16)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Uint16.QuoRem for T-division and modulus (like Go).

func (Uint16) Format

func (a Uint16) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Uint16) IsZero

func (a Uint16) IsZero() bool

IsZero returns true if a is zero.

func (Uint16) LeadingZeros

func (a Uint16) LeadingZeros() int

LeadingZeros returns the number of leading zero bits in a; the result is 16 for a == 0.

func (Uint16) Lsh

func (a Uint16) Lsh(i uint) Uint16

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Uint16) Mod

func (a Uint16) Mod(b Uint16) Uint16

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Uint16.DivMod for more details.

func (Uint16) Mul

func (a Uint16) Mul(b Uint16) Uint16

Mul returns the product a*b.

func (Uint16) Mul32

func (a Uint16) Mul32(b Uint16) Uint32

Mul32 returns the product a*b, the result is a 32-bit integer.

func (Uint16) Neg

func (a Uint16) Neg() Uint16

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Uint16) Not

func (a Uint16) Not() Uint16

Not returns the bitwise NOT of a.

func (Uint16) Or

func (a Uint16) Or(b Uint16) Uint16

Or returns the bitwise OR of a and b.

func (Uint16) Quo

func (a Uint16) Quo(b Uint16) Uint16

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Uint16.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Quo simply forwards to Div.

func (Uint16) QuoRem

func (a Uint16) QuoRem(b Uint16) (Uint16, Uint16)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Uint16.DivMod for Euclidean division and modulus (unlike Go). For unsigned integers T‑division and Euclidean division are identical, therefore QuoRem simply forwards to DivMod.

func (Uint16) Rem

func (a Uint16) Rem(b Uint16) Uint16

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Uint16.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Rem simply forwards to Mod.

func (Uint16) Rsh

func (a Uint16) Rsh(i uint) Uint16

Rsh returns the logical right shift a>>i.

This function's execution time does not depend on the inputs.

func (Uint16) Sign

func (a Uint16) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, and 0 if a == 0. It does not return -1 because Uint16 is unsigned.

func (Uint16) String

func (a Uint16) String() string

String returns the string representation of a in base 10.

func (Uint16) Sub

func (a Uint16) Sub(b Uint16) Uint16

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Uint16) Text

func (a Uint16) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Uint16) TrailingZeros

func (a Uint16) TrailingZeros() int

TrailingZeros returns the number of trailing zero bits in a; the result is 16 for a == 0.

func (Uint16) Uint8

func (a Uint16) Uint8() Uint8

Uint8 converts a to an Uint8.

func (Uint16) Uint16

func (a Uint16) Uint16() Uint16

Uint16 returns a itself.

func (Uint16) Uint32

func (a Uint16) Uint32() Uint32

Uint32 converts a to an Uint32.

func (Uint16) Uint64

func (a Uint16) Uint64() Uint64

Uint64 converts a to an Uint64.

func (Uint16) Uint128

func (a Uint16) Uint128() Uint128

Uint128 converts a to an Uint128.

func (Uint16) Uint256

func (a Uint16) Uint256() Uint256

Uint256 converts a to an Uint256.

func (Uint16) Uint512

func (a Uint16) Uint512() Uint512

Uint512 converts a to an Uint512.

func (Uint16) Uint1024

func (a Uint16) Uint1024() Uint1024

Uint1024 converts a to an Uint1024.

func (Uint16) Xor

func (a Uint16) Xor(b Uint16) Uint16

Xor returns the bitwise XOR of a and b.

type Uint32

type Uint32 uint32

Uint32 is a type that represents an 32-bit unsigned integer. It is an alias for the built-in uint32 type.

func (Uint32) Add

func (a Uint32) Add(b Uint32) Uint32

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Uint32) And

func (a Uint32) And(b Uint32) Uint32

And returns the bitwise AND of a and b.

func (Uint32) AndNot

func (a Uint32) AndNot(b Uint32) Uint32

AndNot returns the bitwise AND NOT of a and b.

func (Uint32) Append

func (a Uint32) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Uint32) AppendText

func (a Uint32) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Uint32) BitLen

func (a Uint32) BitLen() int

BitLen returns the number of bits required to represent a in binary; the result is 0 for a == 0.

func (Uint32) Cmp

func (a Uint32) Cmp(b Uint32) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Uint32) Div

func (a Uint32) Div(b Uint32) Uint32

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Uint32.DivMod for more details.

func (Uint32) DivMod

func (a Uint32) DivMod(b Uint32) (Uint32, Uint32)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Uint32.QuoRem for T-division and modulus (like Go).

func (Uint32) Format

func (a Uint32) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Uint32) IsZero

func (a Uint32) IsZero() bool

IsZero returns true if a is zero.

func (Uint32) LeadingZeros

func (a Uint32) LeadingZeros() int

LeadingZeros returns the number of leading zero bits in a; the result is 32 for a == 0.

func (Uint32) Lsh

func (a Uint32) Lsh(i uint) Uint32

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Uint32) Mod

func (a Uint32) Mod(b Uint32) Uint32

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Uint32.DivMod for more details.

func (Uint32) Mul

func (a Uint32) Mul(b Uint32) Uint32

Mul returns the product a*b.

func (Uint32) Mul64

func (a Uint32) Mul64(b Uint32) Uint64

Mul64 returns the product a*b, the result is a 64-bit integer.

func (Uint32) Neg

func (a Uint32) Neg() Uint32

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Uint32) Not

func (a Uint32) Not() Uint32

Not returns the bitwise NOT of a.

func (Uint32) Or

func (a Uint32) Or(b Uint32) Uint32

Or returns the bitwise OR of a and b.

func (Uint32) Quo

func (a Uint32) Quo(b Uint32) Uint32

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Uint32.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Quo simply forwards to Div.

func (Uint32) QuoRem

func (a Uint32) QuoRem(b Uint32) (Uint32, Uint32)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Uint32.DivMod for Euclidean division and modulus (unlike Go). For unsigned integers T‑division and Euclidean division are identical, therefore QuoRem simply forwards to DivMod.

func (Uint32) Rem

func (a Uint32) Rem(b Uint32) Uint32

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Uint32.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Rem simply forwards to Mod.

func (Uint32) Rsh

func (a Uint32) Rsh(i uint) Uint32

Rsh returns the logical right shift a>>i.

This function's execution time does not depend on the inputs.

func (Uint32) Sign

func (a Uint32) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, and 0 if a == 0. It does not return -1 because Uint32 is unsigned.

func (Uint32) String

func (a Uint32) String() string

String returns the string representation of a in base 10.

func (Uint32) Sub

func (a Uint32) Sub(b Uint32) Uint32

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Uint32) Text

func (a Uint32) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Uint32) TrailingZeros

func (a Uint32) TrailingZeros() int

TrailingZeros returns the number of trailing zero bits in a; the result is 32 for a == 0.

func (Uint32) Uint8

func (a Uint32) Uint8() Uint8

Uint8 converts a to an Uint8.

func (Uint32) Uint16

func (a Uint32) Uint16() Uint16

Uint16 converts a to an Uint16.

func (Uint32) Uint32

func (a Uint32) Uint32() Uint32

Uint32 returns a itself.

func (Uint32) Uint64

func (a Uint32) Uint64() Uint64

Uint64 converts a to an Uint64.

func (Uint32) Uint128

func (a Uint32) Uint128() Uint128

Uint128 converts a to an Uint128.

func (Uint32) Uint256

func (a Uint32) Uint256() Uint256

Uint256 converts a to an Uint256.

func (Uint32) Uint512

func (a Uint32) Uint512() Uint512

Uint512 converts a to an Uint512.

func (Uint32) Uint1024

func (a Uint32) Uint1024() Uint1024

Uint1024 converts a to an Uint1024.

func (Uint32) Xor

func (a Uint32) Xor(b Uint32) Uint32

Xor returns the bitwise XOR of a and b.

type Uint64

type Uint64 uint64

Uint64 is a type that represents an 64-bit unsigned integer. It is an alias for the built-in uint64 type.

func (Uint64) Add

func (a Uint64) Add(b Uint64) Uint64

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Uint64) And

func (a Uint64) And(b Uint64) Uint64

And returns the bitwise AND of a and b.

func (Uint64) AndNot

func (a Uint64) AndNot(b Uint64) Uint64

AndNot returns the bitwise AND NOT of a and b.

func (Uint64) Append

func (a Uint64) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Uint64) AppendText

func (a Uint64) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Uint64) BitLen

func (a Uint64) BitLen() int

BitLen returns the number of bits required to represent a in binary; the result is 0 for a == 0.

func (Uint64) Cmp

func (a Uint64) Cmp(b Uint64) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Uint64) Div

func (a Uint64) Div(b Uint64) Uint64

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Uint64.DivMod for more details.

func (Uint64) DivMod

func (a Uint64) DivMod(b Uint64) (Uint64, Uint64)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Uint64.QuoRem for T-division and modulus (like Go).

func (Uint64) Format

func (a Uint64) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Uint64) IsZero

func (a Uint64) IsZero() bool

IsZero returns true if a is zero.

func (Uint64) LeadingZeros

func (a Uint64) LeadingZeros() int

LeadingZeros returns the number of leading zero bits in a; the result is 64 for a == 0.

func (Uint64) Lsh

func (a Uint64) Lsh(i uint) Uint64

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Uint64) Mod

func (a Uint64) Mod(b Uint64) Uint64

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Uint64.DivMod for more details.

func (Uint64) Mul

func (a Uint64) Mul(b Uint64) Uint64

Mul returns the product a*b.

func (Uint64) Mul128

func (a Uint64) Mul128(b Uint64) Uint128

Mul128 returns the product a*b, the result is a 128-bit integer.

func (Uint64) Neg

func (a Uint64) Neg() Uint64

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Uint64) Not

func (a Uint64) Not() Uint64

Not returns the bitwise NOT of a.

func (Uint64) Or

func (a Uint64) Or(b Uint64) Uint64

Or returns the bitwise OR of a and b.

func (Uint64) Quo

func (a Uint64) Quo(b Uint64) Uint64

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Uint64.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Quo simply forwards to Div.

func (Uint64) QuoRem

func (a Uint64) QuoRem(b Uint64) (Uint64, Uint64)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Uint64.DivMod for Euclidean division and modulus (unlike Go). For unsigned integers T‑division and Euclidean division are identical, therefore QuoRem simply forwards to DivMod.

func (Uint64) Rem

func (a Uint64) Rem(b Uint64) Uint64

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Uint64.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Rem simply forwards to Mod.

func (Uint64) Rsh

func (a Uint64) Rsh(i uint) Uint64

Rsh returns the logical right shift a>>i.

This function's execution time does not depend on the inputs.

func (Uint64) Sign

func (a Uint64) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, and 0 if a == 0. It does not return -1 because Uint64 is unsigned.

func (Uint64) String

func (a Uint64) String() string

String returns the string representation of a in base 10.

func (Uint64) Sub

func (a Uint64) Sub(b Uint64) Uint64

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Uint64) Text

func (a Uint64) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Uint64) TrailingZeros

func (a Uint64) TrailingZeros() int

TrailingZeros returns the number of trailing zero bits in a; the result is 64 for a == 0.

func (Uint64) Uint8

func (a Uint64) Uint8() Uint8

Uint8 converts a to an Uint8.

func (Uint64) Uint16

func (a Uint64) Uint16() Uint16

Uint16 converts a to an Uint16.

func (Uint64) Uint32

func (a Uint64) Uint32() Uint32

Uint32 converts a to an Uint32.

func (Uint64) Uint64

func (a Uint64) Uint64() Uint64

Uint64 returns a itself.

func (Uint64) Uint128

func (a Uint64) Uint128() Uint128

Uint128 converts a to an Uint128.

func (Uint64) Uint256

func (a Uint64) Uint256() Uint256

Uint256 converts a to an Uint256.

func (Uint64) Uint512

func (a Uint64) Uint512() Uint512

Uint512 converts a to an Uint512.

func (Uint64) Uint1024

func (a Uint64) Uint1024() Uint1024

Uint1024 converts a to an Uint1024.

func (Uint64) Xor

func (a Uint64) Xor(b Uint64) Uint64

Xor returns the bitwise XOR of a and b.

type Uint128

type Uint128 [2]uint64

Uint128 is a type that represents an 128-bit unsigned integer.

func (Uint128) Add

func (a Uint128) Add(b Uint128) Uint128

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Uint128) And

func (a Uint128) And(b Uint128) Uint128

And returns the bitwise AND of a and b.

func (Uint128) AndNot

func (a Uint128) AndNot(b Uint128) Uint128

AndNot returns the bitwise AND NOT of a and b.

func (Uint128) Append

func (a Uint128) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Uint128) AppendText

func (a Uint128) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Uint128) BitLen

func (a Uint128) BitLen() int

BitLen returns the number of bits required to represent x in binary; the result is 0 for x == 0.

func (Uint128) Cmp

func (a Uint128) Cmp(b Uint128) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Uint128) Div

func (a Uint128) Div(b Uint128) Uint128

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Uint128.DivMod for more details.

func (Uint128) DivMod

func (a Uint128) DivMod(b Uint128) (Uint128, Uint128)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Uint128.QuoRem for T-division and modulus (like Go).

func (Uint128) Format

func (a Uint128) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Uint128) IsZero

func (a Uint128) IsZero() bool

IsZero returns true if a is zero.

func (Uint128) LeadingZeros

func (a Uint128) LeadingZeros() int

LeadingZeros returns the number of leading zero bits in x; the result is 128 for x == 0.

func (Uint128) Lsh

func (a Uint128) Lsh(i uint) Uint128

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Uint128) Mod

func (a Uint128) Mod(b Uint128) Uint128

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Uint128.DivMod for more details.

func (Uint128) Mul

func (a Uint128) Mul(b Uint128) Uint128

Mul returns the product a*b.

This function's execution time does not depend on the inputs.

func (Uint128) Mul256

func (a Uint128) Mul256(b Uint128) Uint256

Mul256 returns the product a*b, the result is a 256-bit integer.

func (Uint128) Neg

func (a Uint128) Neg() Uint128

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Uint128) Not

func (a Uint128) Not() Uint128

Not returns the bitwise NOT of a.

func (Uint128) Or

func (a Uint128) Or(b Uint128) Uint128

Or returns the bitwise OR of a and b.

func (Uint128) Quo

func (a Uint128) Quo(b Uint128) Uint128

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Uint128.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Quo simply forwards to Div.

func (Uint128) QuoRem

func (a Uint128) QuoRem(b Uint128) (Uint128, Uint128)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Uint128.DivMod for Euclidean division and modulus (unlike Go). For unsigned integers T‑division and Euclidean division are identical, therefore QuoRem simply forwards to DivMod.

func (Uint128) Rem

func (a Uint128) Rem(b Uint128) Uint128

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Uint128.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Rem simply forwards to Mod.

func (Uint128) Rsh

func (a Uint128) Rsh(i uint) Uint128

Rsh returns the logical right shift a>>i.

This function's execution time does not depend on the inputs.

func (Uint128) Sign

func (a Uint128) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, and 0 if a == 0. It does not return -1 because Uint128 is unsigned.

func (Uint128) String

func (a Uint128) String() string

String returns the string representation of a in base 10.

func (Uint128) Sub

func (a Uint128) Sub(b Uint128) Uint128

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Uint128) Text

func (a Uint128) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Uint128) TrailingZeros

func (a Uint128) TrailingZeros() int

TrailingZeros returns the number of trailing zero bits in x; the result is 128 for x == 0.

func (Uint128) Uint8

func (a Uint128) Uint8() Uint8

Uint8 converts a to an Uint8.

func (Uint128) Uint16

func (a Uint128) Uint16() Uint16

Uint16 converts a to an Uint16.

func (Uint128) Uint32

func (a Uint128) Uint32() Uint32

Uint32 converts a to an Uint32.

func (Uint128) Uint64

func (a Uint128) Uint64() Uint64

Uint64 converts a to an Uint64.

func (Uint128) Uint128

func (a Uint128) Uint128() Uint128

Uint128 returns a itself.

func (Uint128) Uint256

func (a Uint128) Uint256() Uint256

Uint256 converts a to an Uint256.

func (Uint128) Uint512

func (a Uint128) Uint512() Uint512

Uint512 converts a to an Uint512.

func (Uint128) Uint1024

func (a Uint128) Uint1024() Uint1024

Uint1024 converts a to an Uint1024.

func (Uint128) Xor

func (a Uint128) Xor(b Uint128) Uint128

Xor returns the bitwise XOR of a and b.

type Uint256

type Uint256 [4]uint64

Uint256 is a type that represents an 256-bit unsigned integer.

func (Uint256) Add

func (a Uint256) Add(b Uint256) Uint256

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Uint256) And

func (a Uint256) And(b Uint256) Uint256

And returns the bitwise AND of a and b.

func (Uint256) AndNot

func (a Uint256) AndNot(b Uint256) Uint256

AndNot returns the bitwise AND NOT of a and b.

func (Uint256) Append

func (a Uint256) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Uint256) AppendText

func (a Uint256) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Uint256) BitLen

func (a Uint256) BitLen() int

BitLen returns the number of bits required to represent a in binary; the result is 0 for a == 0.

func (Uint256) Cmp

func (a Uint256) Cmp(b Uint256) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Uint256) Div

func (a Uint256) Div(b Uint256) Uint256

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Uint256.DivMod for more details.

func (Uint256) DivMod

func (a Uint256) DivMod(b Uint256) (Uint256, Uint256)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Uint256.QuoRem for T-division and modulus (like Go).

func (Uint256) Format

func (a Uint256) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Uint256) IsZero

func (a Uint256) IsZero() bool

IsZero returns true if a is zero.

func (Uint256) LeadingZeros

func (a Uint256) LeadingZeros() int

LeadingZeros returns the number of leading zero bits in a; the result is 256 for a == 0.

func (Uint256) Lsh

func (a Uint256) Lsh(i uint) Uint256

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Uint256) Mod

func (a Uint256) Mod(b Uint256) Uint256

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Uint256.DivMod for more details.

func (Uint256) Mul

func (a Uint256) Mul(b Uint256) Uint256

Mul returns the product a*b.

func (Uint256) Mul512

func (a Uint256) Mul512(b Uint256) Uint512

Mul512 returns the product a*b, the result is a 512-bit integer.

func (Uint256) Neg

func (a Uint256) Neg() Uint256

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Uint256) Not

func (a Uint256) Not() Uint256

Not returns the bitwise NOT of a.

func (Uint256) Or

func (a Uint256) Or(b Uint256) Uint256

Or returns the bitwise OR of a and b.

func (Uint256) Quo

func (a Uint256) Quo(b Uint256) Uint256

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Uint256.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Quo simply forwards to Div.

func (Uint256) QuoRem

func (a Uint256) QuoRem(b Uint256) (Uint256, Uint256)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Uint256.DivMod for Euclidean division and modulus (unlike Go). For unsigned integers T‑division and Euclidean division are identical, therefore QuoRem simply forwards to DivMod.

func (Uint256) Rem

func (a Uint256) Rem(b Uint256) Uint256

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Uint256.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Rem simply forwards to Mod.

func (Uint256) Rsh

func (a Uint256) Rsh(i uint) Uint256

Rsh returns the logical right shift a>>i.

This function's execution time does not depend on the inputs.

func (Uint256) Sign

func (a Uint256) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, and 0 if a == 0. It does not return -1 because Uint256 is unsigned.

func (Uint256) String

func (a Uint256) String() string

String returns the string representation of a in base 10.

func (Uint256) Sub

func (a Uint256) Sub(b Uint256) Uint256

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Uint256) Text

func (a Uint256) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Uint256) TrailingZeros

func (a Uint256) TrailingZeros() int

TrailingZeros returns the number of trailing zero bits in a; the result is 256 for a == 0.

func (Uint256) Uint8

func (a Uint256) Uint8() Uint8

Uint8 converts a to an Uint8.

func (Uint256) Uint16

func (a Uint256) Uint16() Uint16

Uint16 converts a to an Uint16.

func (Uint256) Uint32

func (a Uint256) Uint32() Uint32

Uint32 converts a to an Uint32.

func (Uint256) Uint64

func (a Uint256) Uint64() Uint64

Uint64 converts a to an Uint64.

func (Uint256) Uint128

func (a Uint256) Uint128() Uint128

Uint128 converts a to an Uint128.

func (Uint256) Uint256

func (a Uint256) Uint256() Uint256

Uint256 returns a itself.

func (Uint256) Uint512

func (a Uint256) Uint512() Uint512

Uint512 converts a to an Uint512.

func (Uint256) Uint1024

func (a Uint256) Uint1024() Uint1024

Uint1024 converts a to an Uint1024.

func (Uint256) Xor

func (a Uint256) Xor(b Uint256) Uint256

Xor returns the bitwise XOR of a and b.

type Uint512

type Uint512 [8]uint64

Uint512 is a type that represents an 512-bit unsigned integer.

func (Uint512) Add

func (a Uint512) Add(b Uint512) Uint512

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Uint512) And

func (a Uint512) And(b Uint512) Uint512

And returns the bitwise AND of a and b.

func (Uint512) AndNot

func (a Uint512) AndNot(b Uint512) Uint512

AndNot returns the bitwise AND NOT of a and b.

func (Uint512) Append

func (a Uint512) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Uint512) AppendText

func (a Uint512) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Uint512) BitLen

func (a Uint512) BitLen() int

BitLen returns the number of bits required to represent a in binary; the result is 0 for a == 0.

func (Uint512) Cmp

func (a Uint512) Cmp(b Uint512) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Uint512) Div

func (a Uint512) Div(b Uint512) Uint512

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Uint512.DivMod for more details.

func (Uint512) DivMod

func (a Uint512) DivMod(b Uint512) (Uint512, Uint512)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Uint512.QuoRem for T-division and modulus (like Go).

func (Uint512) Format

func (a Uint512) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Uint512) IsZero

func (a Uint512) IsZero() bool

IsZero returns true if a is zero.

func (Uint512) LeadingZeros

func (a Uint512) LeadingZeros() int

LeadingZeros returns the number of leading zero bits in a; the result is 512 for a == 0.

func (Uint512) Lsh

func (a Uint512) Lsh(i uint) Uint512

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Uint512) Mod

func (a Uint512) Mod(b Uint512) Uint512

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Uint512.DivMod for more details.

func (Uint512) Mul

func (a Uint512) Mul(b Uint512) Uint512

Mul returns the product a*b.

This function's execution time does not depend on the inputs.

func (Uint512) Mul1024

func (a Uint512) Mul1024(b Uint512) Uint1024

Mul1024 returns the product a*b, the result is a 1024-bit integer.

This function's execution time does not depend on the inputs.

func (Uint512) Neg

func (a Uint512) Neg() Uint512

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Uint512) Not

func (a Uint512) Not() Uint512

Not returns the bitwise NOT of a.

func (Uint512) Or

func (a Uint512) Or(b Uint512) Uint512

Or returns the bitwise OR of a and b.

func (Uint512) Quo

func (a Uint512) Quo(b Uint512) Uint512

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Uint512.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Quo simply forwards to Div.

func (Uint512) QuoRem

func (a Uint512) QuoRem(b Uint512) (Uint512, Uint512)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Uint512.DivMod for Euclidean division and modulus (unlike Go). For unsigned integers T‑division and Euclidean division are identical, therefore QuoRem simply forwards to DivMod.

func (Uint512) Rem

func (a Uint512) Rem(b Uint512) Uint512

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Uint512.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Rem simply forwards to Mod.

func (Uint512) Rsh

func (a Uint512) Rsh(i uint) Uint512

Rsh returns the logical right shift a>>i.

This function's execution time does not depend on the inputs.

func (Uint512) Sign

func (a Uint512) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, and 0 if a == 0. It does not return -1 because Uint512 is unsigned.

func (Uint512) String

func (a Uint512) String() string

String returns the string representation of a in base 10.

func (Uint512) Sub

func (a Uint512) Sub(b Uint512) Uint512

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Uint512) Text

func (a Uint512) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Uint512) TrailingZeros

func (a Uint512) TrailingZeros() int

TrailingZeros returns the number of trailing zero bits in a; the result is 512 for a == 0.

func (Uint512) Uint8

func (a Uint512) Uint8() Uint8

Uint8 converts a to an Uint8.

func (Uint512) Uint16

func (a Uint512) Uint16() Uint16

Uint16 converts a to an Uint16.

func (Uint512) Uint32

func (a Uint512) Uint32() Uint32

Uint32 converts a to an Uint32.

func (Uint512) Uint64

func (a Uint512) Uint64() Uint64

Uint64 converts a to an Uint64.

func (Uint512) Uint128

func (a Uint512) Uint128() Uint128

Uint128 converts a to an Uint128.

func (Uint512) Uint256

func (a Uint512) Uint256() Uint256

Uint256 converts a to an Uint256.

func (Uint512) Uint512

func (a Uint512) Uint512() Uint512

Uint512 returns a itself.

func (Uint512) Uint1024

func (a Uint512) Uint1024() Uint1024

Uint1024 converts a to an Uint1024.

func (Uint512) Xor

func (a Uint512) Xor(b Uint512) Uint512

Xor returns the bitwise XOR of a and b.

type Uint1024

type Uint1024 [16]uint64

Uint1024 is a type that represents an 1024-bit unsigned integer.

func (Uint1024) Add

func (a Uint1024) Add(b Uint1024) Uint1024

Add returns the sum a+b.

This function's execution time does not depend on the inputs.

func (Uint1024) And

func (a Uint1024) And(b Uint1024) Uint1024

And returns the bitwise AND of a and b.

func (Uint1024) AndNot

func (a Uint1024) AndNot(b Uint1024) Uint1024

AndNot returns the bitwise AND NOT of a and b.

func (Uint1024) Append

func (a Uint1024) Append(dst []byte, base int) []byte

Append appends the string representation of a, as generated by a.Text(base), to buf and returns the extended buffer.

func (Uint1024) AppendText

func (a Uint1024) AppendText(dst []byte) ([]byte, error)

AppendText implements the encoding.TextAppender interface.

func (Uint1024) BitLen

func (a Uint1024) BitLen() int

BitLen returns the number of bits required to represent a in binary; the result is 0 for a == 0.

func (Uint1024) Cmp

func (a Uint1024) Cmp(b Uint1024) int

Cmp returns the comparison result of a and b. It returns -1 if a < b, 0 if a == b, and 1 if a > b.

func (Uint1024) Div

func (a Uint1024) Div(b Uint1024) Uint1024

Div returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Div implements Euclidean division (unlike Go); see Uint1024.DivMod for more details.

func (Uint1024) DivMod

func (a Uint1024) DivMod(b Uint1024) (Uint1024, Uint1024)

DivMod returns the quotient and remainder of a/b. DivMod implements Euclidean division and modulus (unlike Go):

q = a div b  such that
m = a - b*q  with 0 <= m < |b|

(See Raymond T. Boute, “The Euclidean definition of the functions div and mod”. ACM Transactions on Programming Languages and Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. ACM press.) See Uint1024.QuoRem for T-division and modulus (like Go).

func (Uint1024) Format

func (a Uint1024) Format(s fmt.State, verb rune)

Format implements fmt.Formatter.

func (Uint1024) IsZero

func (a Uint1024) IsZero() bool

IsZero returns true if a is zero.

func (Uint1024) LeadingZeros

func (a Uint1024) LeadingZeros() int

LeadingZeros returns the number of leading zero bits in a; the result is 1024 for a == 0.

func (Uint1024) Lsh

func (a Uint1024) Lsh(i uint) Uint1024

Lsh returns the logical left shift a<<i.

This function's execution time does not depend on the inputs.

func (Uint1024) Mod

func (a Uint1024) Mod(b Uint1024) Uint1024

Mod returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Mod implements Euclidean division (unlike Go); see Uint1024.DivMod for more details.

func (Uint1024) Mul

func (a Uint1024) Mul(b Uint1024) Uint1024

Mul returns the product a*b.

This function's execution time does not depend on the inputs.

func (Uint1024) Neg

func (a Uint1024) Neg() Uint1024

Neg returns the negation of a.

This function's execution time does not depend on the inputs.

func (Uint1024) Not

func (a Uint1024) Not() Uint1024

Not returns the bitwise NOT of a.

func (Uint1024) Or

func (a Uint1024) Or(b Uint1024) Uint1024

Or returns the bitwise OR of a and b.

func (Uint1024) Quo

func (a Uint1024) Quo(b Uint1024) Uint1024

Quo returns the quotient a/b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Quo implements T-division (like Go); see Uint1024.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Quo simply forwards to Div.

func (Uint1024) QuoRem

func (a Uint1024) QuoRem(b Uint1024) (Uint1024, Uint1024)

QuoRem returns the quotient and remainder of a/b. QuoRem implements T-division and modulus (like Go):

q = a/b      with the result truncated to zero
r = a - b*q

(See Daan Leijen, “Division and Modulus for Computer Scientists”.) See Uint1024.DivMod for Euclidean division and modulus (unlike Go). For unsigned integers T‑division and Euclidean division are identical, therefore QuoRem simply forwards to DivMod.

func (Uint1024) Rem

func (a Uint1024) Rem(b Uint1024) Uint1024

Rem returns the remainder a%b for b != 0. If b == 0, a division-by-zero run-time panic occurs. Rem implements T-division (like Go); see Uint1024.QuoRem for more details. For unsigned integers T‑division and Euclidean division are identical, therefore Rem simply forwards to Mod.

func (Uint1024) Rsh

func (a Uint1024) Rsh(i uint) Uint1024

Rsh returns the logical right shift a>>i.

This function's execution time does not depend on the inputs.

func (Uint1024) Sign

func (a Uint1024) Sign() int

Sign returns the sign of a. It returns 1 if a > 0, and 0 if a == 0. It does not return -1 because Uint128 is unsigned.

func (Uint1024) String

func (a Uint1024) String() string

String returns the string representation of a in base 10.

func (Uint1024) Sub

func (a Uint1024) Sub(b Uint1024) Uint1024

Sub returns the difference a-b.

This function's execution time does not depend on the inputs.

func (Uint1024) Text

func (a Uint1024) Text(base int) string

Text returns the string representation of a in the given base. Base must be between 2 and 62, inclusive. The result uses the lower-case letters 'a' to 'z' for digit values 10 to 35, and the upper-case letters 'A' to 'Z' for digit values 36 to 61. No prefix (such as "0x") is added to the string.

func (Uint1024) TrailingZeros

func (a Uint1024) TrailingZeros() int

TrailingZeros returns the number of trailing zero bits in a; the result is 1024 for a == 0.

func (Uint1024) Uint8

func (a Uint1024) Uint8() Uint8

Uint8 converts a to an Uint8.

func (Uint1024) Uint16

func (a Uint1024) Uint16() Uint16

Uint16 converts a to an Uint16.

func (Uint1024) Uint32

func (a Uint1024) Uint32() Uint32

Uint32 converts a to an Uint32.

func (Uint1024) Uint64

func (a Uint1024) Uint64() Uint64

Uint64 converts a to an Uint64.

func (Uint1024) Uint128

func (a Uint1024) Uint128() Uint128

Uint128 converts a to an Uint128.

func (Uint1024) Uint256

func (a Uint1024) Uint256() Uint256

Uint256 converts a to an Uint256.

func (Uint1024) Uint512

func (a Uint1024) Uint512() Uint512

Uint512 converts a to an Uint512.

func (Uint1024) Uint1024

func (a Uint1024) Uint1024() Uint1024

Uint1024 returns a itself.

func (Uint1024) Xor

func (a Uint1024) Xor(b Uint1024) Uint1024

Xor returns the bitwise XOR of a and b.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL