Documentation ¶
Index ¶
- func DoubleToSortableLong(value float64) uint64
- func IntToSortableBytes(value int32, result []byte)
- func LongToSortableBytes(num uint64, result []byte)
- func SortableBytesToInt(encoded []byte) int32
- func SortableBytesToLong(encoded []byte) int64
- func SortableBytesToUint64(encoded []byte) uint64
- func SortableDoubleBits(bits uint64) uint64
- func SortableLongToDouble(encoded uint64) float64
- func Subtract(bytesPerDim, dim int, a, b, result []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoubleToSortableLong ¶
DoubleToSortableLong 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 LongToSortableBytes ¶
LongToSortableBytes Encodes an long value such that unsigned byte order comparison is consistent with Long.compare(long, long) See Also: sortableBytesToLong(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 longToSortableBytes See Also: LongToSortableBytes(uint64, []byte)
func SortableBytesToUint64 ¶
func SortableDoubleBits ¶
SortableDoubleBits Converts IEEE 754 representation of a double to sortable order (or back to the original)
func SortableLongToDouble ¶
SortableLongToDouble Converts a sortable long back to a double. 请参阅: DoubleToSortableLong
Types ¶
This section is empty.