numeric

package
v0.0.0-...-53ff736 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoubleToSortableLong

func DoubleToSortableLong(value float64) uint64

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

func IntToSortableBytes(value int32, result []byte)

IntToSortableBytes Encodes an int32 value such that unsigned byte order comparison is consistent with Integer.compare(int, int) 请参阅: SortableBytesToInt(byte[], int)

func LongToSortableBytes

func LongToSortableBytes(num uint64, result []byte)

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

func SortableBytesToInt(encoded []byte) int32

SortableBytesToInt Decodes an integer value previously written with intToSortableBytes 请参阅: IntToSortableBytes(int, byte[])

func SortableBytesToLong

func SortableBytesToLong(encoded []byte) int64

SortableBytesToLong Decodes a long value previously written with longToSortableBytes See Also: LongToSortableBytes(uint64, []byte)

func SortableBytesToUint64

func SortableBytesToUint64(encoded []byte) uint64

func SortableDoubleBits

func SortableDoubleBits(bits uint64) uint64

SortableDoubleBits Converts IEEE 754 representation of a double to sortable order (or back to the original)

func SortableLongToDouble

func SortableLongToDouble(encoded uint64) float64

SortableLongToDouble Converts a sortable long back to a double. 请参阅: DoubleToSortableLong

func Subtract

func Subtract(bytesPerDim, dim int, a, b, result []byte) error

Subtract Result = a - b, where a >= b, else IllegalArgumentException is thrown.

Types

This section is empty.

Jump to

Keyboard shortcuts

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