Documentation ¶
Overview ¶
Package uintconv provides one-to-one mappings between unsigned integers and signed integers or floating-point numbers, so that the encoding and decoding functions for unsigned integers can be applied to signed integers and floating-point numbers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromFloat64ByteReversal ¶
FromFloat64ByteReversal maps a 64-bit floating-point number to a 64-bit unsigned integer.
It converts the specified float64 to uint64 using math.Float64bits and then returns the byte-reversal of that uint64.
It satisfies:
FromFloat64ByteReversal(ToFloat64ByteReversal(x)) == x.
func FromInt64Zigzag ¶
FromInt64Zigzag maps a 64-bit signed integer to a 64-bit unsigned integer with zigzag encoding.
FromInt64Zigzag(ToInt64Zigzag(x)) == x.
func ToFloat64ByteReversal ¶
ToFloat64ByteReversal maps a 64-bit unsigned integer back to a 64-bit floating-point number.
It converts the byte-reversal of the specified uint64 to float64 using math.Float64frombits.
It satisfies:
ToFloat64ByteReversal(FromFloat64ByteReversal(x)) == x.
func ToInt64Zigzag ¶
ToInt64Zigzag maps a 64-bit unsigned integer back to a 64-bit signed integer with zigzag encoding.
ToInt64Zigzag(FromInt64Zigzag(x)) == x.
Types ¶
This section is empty.