Documentation
¶
Index ¶
- func Float64ToSortableLong(value float64) uint64
- func IntToSortableBytes(value int32, result []byte)
- func SortableBytesToInt(encoded []byte) int32
- func SortableBytesToLong(encoded []byte) int64
- func SortableBytesToUint64(encoded []byte) uint64
- func SortableFloat64Bits(bits uint64) uint64
- func SortableUint64ToFloat64(encoded uint64) float64
- func Subtract(bytesPerDim, dim int, a, b, result []byte) error
- func Uint64ToSortableBytes(num uint64, result []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Float64ToSortableLong ¶ added in v0.0.2
Float64ToSortableLong Converts a double value to a sortable signed long. The value is converted by getting their IEEE 754 floating-point "double format" bit layout and then some bits are swapped, to be able to compare the result as long. By this the precision is not reduced, but the value can easily used as a long. The sort order (including Double.NaN) is defined by Double.compareTo; NaN is greater than positive infinity. SortableLongToDouble
func IntToSortableBytes ¶
IntToSortableBytes Encodes an int32 value such that unsigned byte order comparison is consistent with Integer.compare(int, int) 请参阅: SortableBytesToInt(byte[], int)
func SortableBytesToInt ¶
SortableBytesToInt Decodes an integer value previously written with intToSortableBytes 请参阅: IntToSortableBytes(int, byte[])
func SortableBytesToLong ¶
SortableBytesToLong Decodes a long value previously written with Uint64ToSortableBytes
func SortableBytesToUint64 ¶
SortableBytesToUint64 Decodes a long value previously written with Uint64ToSortableBytes
func SortableFloat64Bits ¶ added in v0.0.2
SortableFloat64Bits Converts IEEE 754 representation of a double to sortable order (or back to the original)
func SortableUint64ToFloat64 ¶ added in v0.0.2
SortableUint64ToFloat64 Converts a sortable long back to a double. 请参阅: Float64ToSortableLong
func Uint64ToSortableBytes ¶ added in v0.0.2
Uint64ToSortableBytes Encodes an long value such that unsigned byte order comparison is consistent with Long.compare(long, long) See Also: sortableBytesToLong(byte[], int)
Types ¶
This section is empty.