Documentation
¶
Overview ¶
Package element provides the element types of typed arrays and the encodings of their elements.
Index ¶
- func Convert(from, to Type, x uint64) uint64
- func DecodeNumber(t Type, x uint64) float64
- func EncodeBigInt(i *big.Int) uint64
- func EncodeNumber(t Type, f float64) uint64
- func Equal(t Type, x, y uint64) bool
- func Load(b []byte, t Type) uint64
- func LoadEndian(b []byte, t Type, littleEndian bool) uint64
- func Store(b []byte, t Type, x uint64)
- func StoreEndian(b []byte, t Type, x uint64, littleEndian bool)
- func StoreNumber(b []byte, t Type, f float64)
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert returns the encoding x of an element of the type from as an element of the type to, as reading the element and storing the value would. Both types must be BigInt types or neither.
func DecodeNumber ¶
DecodeNumber returns the number that the encoding x of an element of the type t, which is not a BigInt type, stands for.
func EncodeBigInt ¶
EncodeBigInt returns i modulo 2^64, the encoding of i as an element of a BigInt type.
func EncodeNumber ¶
EncodeNumber returns the encoding of the number f as an element of the type t, which is not a BigInt type.
func Equal ¶
Equal reports whether the encodings x and y are equal in the size of an element of the type t.
func Load ¶
Load returns the encoding of the element of the type t at the start of b in little-endian byte order.
func LoadEndian ¶
LoadEndian returns the encoding of the element of the type t at the start of b in the given byte order.
func Store ¶
Store stores the encoding x of an element of the type t at the start of b in little-endian byte order.
func StoreEndian ¶
StoreEndian stores the encoding x of an element of the type t at the start of b in the given byte order.
func StoreNumber ¶
StoreNumber stores the number f as an element of the type t, which is not a BigInt type, at the start of b in little-endian byte order.