package decimal256
import "github.com/apache/arrow-go/v18/arrow/decimal256"
Index ¶
- Constants
- type Num
- func FromBigInt(v *big.Int) (n Num)
- func FromDecimal128(n decimal128.Num) Num
- func FromFloat32(v float32, prec, scale int32) (Num, error)
- func FromFloat64(v float64, prec, scale int32) (Num, error)
- func FromI64(v int64) Num
- func FromString(v string, prec, scale int32) (n Num, err error)
- func FromU64(v uint64) Num
- func GetHalfScaleMultiplier(pow int) Num
- func GetMaxValue(prec int32) Num
- func GetScaleMultiplier(pow int) Num
- func Max(first Num, rest ...Num) Num
- func Min(first Num, rest ...Num) Num
- func New(x1, x2, x3, x4 uint64) Num
- func (n Num) Abs() Num
- func (n Num) Add(rhs Num) Num
- func (n Num) Array() [4]uint64
- func (n Num) BigInt() *big.Int
- func (n Num) Cmp(other Num) int
- func (n Num) Div(rhs Num) (res, rem Num)
- func (n Num) FitsInPrecision(prec int32) bool
- func (n Num) Greater(other Num) bool
- func (n Num) GreaterEqual(other Num) bool
- func (n Num) IncreaseScaleBy(increase int32) Num
- func (n Num) Less(other Num) bool
- func (n Num) LessEqual(other Num) bool
- func (n Num) LowBits() uint64
- func (n Num) Mul(rhs Num) Num
- func (n Num) Negate() Num
- func (n Num) Pow(rhs Num) Num
- func (n Num) ReduceScaleBy(reduce int32, round bool) Num
- func (n Num) Rescale(original, newscale int32) (out Num, err error)
- func (n Num) Sign() int
- func (n Num) Sub(rhs Num) Num
- func (n Num) ToBigFloat(scale int32) *big.Float
- func (n Num) ToFloat32(scale int32) float32
- func (n Num) ToFloat64(scale int32) float64
- func (n Num) ToString(scale int32) string
Constants ¶
const ( MaxPrecision = 76 MaxScale = 76 )
Types ¶
type Num ¶
type Num struct {
// contains filtered or unexported fields
}
func FromBigInt ¶
func FromDecimal128 ¶
func FromDecimal128(n decimal128.Num) Num
func FromFloat32 ¶
func FromFloat64 ¶
func FromI64 ¶
func FromString ¶
func FromU64 ¶
func GetHalfScaleMultiplier ¶
func GetMaxValue ¶
func GetScaleMultiplier ¶
func Max ¶
Max returns the largest Decimal256 that was passed in the arguments
func Min ¶
Min returns the smallest Decimal256 that was passed in the arguments
func New ¶
New returns a new signed 256-bit integer value where x1 contains the highest bits with the rest of the values in order down to the lowest bits
ie: New(1, 2, 3, 4) returns with the elements in little-endian order {4, 3, 2, 1} but each value is still represented as the native endianness
func (Num) Abs ¶
func (Num) Add ¶
func (Num) Array ¶
func (Num) BigInt ¶
func (Num) Cmp ¶
Cmp compares the numbers represented by n and other and returns:
+1 if n > other 0 if n == other -1 if n < other
func (Num) Div ¶
func (Num) FitsInPrecision ¶
func (Num) Greater ¶
Greater returns true if the value represented by n is > other
func (Num) GreaterEqual ¶
GreaterEqual returns true if the value represented by n is >= other
func (Num) IncreaseScaleBy ¶
func (Num) Less ¶
Less returns true if the value represented by n is < other
func (Num) LessEqual ¶
LessEqual returns true if the value represented by n is <= other
func (Num) LowBits ¶
func (Num) Mul ¶
func (Num) Negate ¶
func (Num) Pow ¶
func (Num) ReduceScaleBy ¶
func (Num) Rescale ¶
func (Num) Sign ¶
func (Num) Sub ¶
func (Num) ToBigFloat ¶
func (Num) ToFloat32 ¶
func (Num) ToFloat64 ¶
func (Num) ToString ¶
Source Files ¶
- Version
- v18.2.0 (latest)
- Published
- Mar 12, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 1 month ago –
Tools for package owners.