package decimal128
import "git.sr.ht/~sbinet/go-arrow/decimal128"
Index ¶
Variables ¶
var (
MaxDecimal128 = New(542101086242752217, 687399551400673280-1)
)
Types ¶
type Num ¶
type Num struct {
// contains filtered or unexported fields
}
Num represents a signed 128-bit integer in two's complement. Calculations wrap around and overflow is ignored.
For a discussion of the algorithms, look at Knuth's volume 2, Semi-numerical Algorithms section 4.3.1.
Adapted from the Apache ORC C++ implementation
func FromI64 ¶
FromI64 returns a new signed 128-bit integer value from the provided int64 one.
func FromU64 ¶
FromU64 returns a new signed 128-bit integer value from the provided uint64 one.
func New ¶
New returns a new signed 128-bit integer value.
func (Num) HighBits ¶
HighBits returns the high bits of the two's complement representation of the number.
func (Num) LowBits ¶
LowBits returns the low bits of the two's complement representation of the number.
func (Num) Sign ¶
Sign returns:
-1 if x < 0
0 if x == 0
+1 if x > 0
Source Files ¶
- Version
- v0.3.0 (latest)
- Published
- Feb 17, 2025
- Platform
- linux/amd64
- Last checked
- 2 months ago –
Tools for package owners.