i256

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Number_1  = int256.NewInt(1)
	Number_2  = int256.NewInt(2)
	Number_3  = int256.NewInt(3)
	Number_4  = int256.NewInt(4)
	Number_10 = int256.NewInt(10)
)
View Source
var (
	ErrNegative = errors.New("convert negative i256 to u256")
)

Functions

func Abs

func Abs(x *int256.Int) *int256.Int

func AbsZ

func AbsZ(x *int256.Int, result *int256.Int) *int256.Int

func Add

func Add(x, y *int256.Int) *int256.Int

func Div

func Div(x, y *int256.Int) *int256.Int

func Lsh

func Lsh(x *int256.Int, n uint) *int256.Int

func Mul

func Mul(x, y *int256.Int) *int256.Int

func MustFromDecimal

func MustFromDecimal(s string) *int256.Int

func Neg

func Neg(x *int256.Int) *int256.Int

func Rsh

func Rsh(x *int256.Int, n uint) *int256.Int

func SafeConvertToInt256

func SafeConvertToInt256(value *uint256.Int, result *int256.Int) error

safely convert uint256 to int256

func SafeConvertToUInt256

func SafeConvertToUInt256(value *int256.Int) *uint256.Int

safely convert to u256 (negative numbers will panic)

func SafeToInt256

func SafeToInt256(value *uint256.Int) *int256.Int

safely convert uint256 to int256

func Set

func Set(x *int256.Int) *int256.Int

func SetInt64

func SetInt64(x int64) *int256.Int

func Sub

func Sub(x, y *int256.Int) *int256.Int

func UnsafeCastToUInt256

func UnsafeCastToUInt256(value *int256.Int, result *uint256.Int)

cast the bytes directly without checking for negative (-1 -> 2^256-1)

func UnsafeToUInt256

func UnsafeToUInt256(value *int256.Int) *uint256.Int

cast the bytes directly without checking for negative (-1 -> 2^256-1)

Types

This section is empty.

Jump to

Keyboard shortcuts

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