package decimal

Import Path
	github.com/apache/arrow-go/v18/arrow/decimal (on go.dev)

Dependency Relation
	imports 11 packages, and imported by 4 packages

Involved Source Files decimal.go traits.go
Package-Level Type Names (total 7)
/* sort by: | */
type Decimal128 = decimal128.Num (struct)
type Decimal256 = decimal256.Num (struct)
( Decimal32) Abs() Decimal32 ( Decimal32) Add(rhs Decimal32) Decimal32 ( Decimal32) Cmp(other Decimal32) int ( Decimal32) Div(rhs Decimal32) (res, rem Decimal32) ( Decimal32) FitsInPrecision(prec int32) bool ( Decimal32) IncreaseScaleBy(increase int32) Decimal32 ( Decimal32) Mul(rhs Decimal32) Decimal32 ( Decimal32) Negate() Decimal32 ( Decimal32) Pow(rhs Decimal32) Decimal32 ( Decimal32) ReduceScaleBy(reduce int32, round bool) Decimal32 ( Decimal32) Rescale(originalScale, newScale int32) (out Decimal32, err error) ( Decimal32) Sign() int ( Decimal32) Sub(rhs Decimal32) Decimal32 ( Decimal32) ToBigFloat(scale int32) *big.Float ( Decimal32) ToFloat32(scale int32) float32 ( Decimal32) ToFloat64(scale int32) float64 ( Decimal32) ToString(scale int32) string Decimal32 : Num[Decimal32] func Decimal32FromFloat[F](v F, prec, scale int32) (Decimal32, error) func Decimal32FromString(v string, prec, scale int32) (n Decimal32, err error) func Decimal32.Abs() Decimal32 func Decimal32.Add(rhs Decimal32) Decimal32 func Decimal32.Div(rhs Decimal32) (res, rem Decimal32) func Decimal32.IncreaseScaleBy(increase int32) Decimal32 func Decimal32.Mul(rhs Decimal32) Decimal32 func Decimal32.Negate() Decimal32 func Decimal32.Pow(rhs Decimal32) Decimal32 func Decimal32.ReduceScaleBy(reduce int32, round bool) Decimal32 func Decimal32.Rescale(originalScale, newScale int32) (out Decimal32, err error) func Decimal32.Sub(rhs Decimal32) Decimal32 func Decimal32.Add(rhs Decimal32) Decimal32 func Decimal32.Cmp(other Decimal32) int func Decimal32.Div(rhs Decimal32) (res, rem Decimal32) func Decimal32.Mul(rhs Decimal32) Decimal32 func Decimal32.Pow(rhs Decimal32) Decimal32 func Decimal32.Sub(rhs Decimal32) Decimal32 func github.com/apache/arrow-go/v18/parquet/variant.(*Builder).AppendDecimal4(scale uint8, v Decimal32) error
( Decimal64) Abs() Decimal64 ( Decimal64) Add(rhs Decimal64) Decimal64 ( Decimal64) Cmp(other Decimal64) int ( Decimal64) Div(rhs Decimal64) (res, rem Decimal64) ( Decimal64) FitsInPrecision(prec int32) bool ( Decimal64) IncreaseScaleBy(increase int32) Decimal64 ( Decimal64) Mul(rhs Decimal64) Decimal64 ( Decimal64) Negate() Decimal64 ( Decimal64) Pow(rhs Decimal64) Decimal64 ( Decimal64) ReduceScaleBy(reduce int32, round bool) Decimal64 ( Decimal64) Rescale(originalScale, newScale int32) (out Decimal64, err error) ( Decimal64) Sign() int ( Decimal64) Sub(rhs Decimal64) Decimal64 ( Decimal64) ToBigFloat(scale int32) *big.Float ( Decimal64) ToFloat32(scale int32) float32 ( Decimal64) ToFloat64(scale int32) float64 ( Decimal64) ToString(scale int32) string Decimal64 : Num[Decimal64] func Decimal64FromFloat[F](v F, prec, scale int32) (Decimal64, error) func Decimal64FromString(v string, prec, scale int32) (n Decimal64, err error) func Decimal64.Abs() Decimal64 func Decimal64.Add(rhs Decimal64) Decimal64 func Decimal64.Div(rhs Decimal64) (res, rem Decimal64) func Decimal64.IncreaseScaleBy(increase int32) Decimal64 func Decimal64.Mul(rhs Decimal64) Decimal64 func Decimal64.Negate() Decimal64 func Decimal64.Pow(rhs Decimal64) Decimal64 func Decimal64.ReduceScaleBy(reduce int32, round bool) Decimal64 func Decimal64.Rescale(originalScale, newScale int32) (out Decimal64, err error) func Decimal64.Sub(rhs Decimal64) Decimal64 func Decimal64.Add(rhs Decimal64) Decimal64 func Decimal64.Cmp(other Decimal64) int func Decimal64.Div(rhs Decimal64) (res, rem Decimal64) func Decimal64.Mul(rhs Decimal64) Decimal64 func Decimal64.Pow(rhs Decimal64) Decimal64 func Decimal64.Sub(rhs Decimal64) Decimal64 func github.com/apache/arrow-go/v18/parquet/variant.(*Builder).AppendDecimal8(scale uint8, v Decimal64) error
DecimalTypes is a generic constraint representing the implemented decimal types in this package, and a single point of update for future additions. Everything else is constrained by this.
Type Parameters: T: DecimalTypes Num is an interface that is useful for building generic types for all decimal type implementations. It presents all the methods and interfaces necessary to operate on the decimal objects without having to care about the bit width. ( Num[T]) Abs() T ( Num[T]) Add(T) T ( Num[T]) Cmp(T) int ( Num[T]) Div(T) (res, rem T) ( Num[T]) FitsInPrecision(int32) bool ( Num[T]) IncreaseScaleBy(int32) T ( Num[T]) Mul(T) T ( Num[T]) Negate() T ( Num[T]) Pow(T) T ( Num[T]) ReduceScaleBy(int32, bool) T ( Num[T]) Rescale(int32, int32) (T, error) ( Num[T]) Sign() int ( Num[T]) Sub(T) T ( Num[T]) ToBigFloat(int32) *big.Float ( Num[T]) ToFloat32(int32) float32 ( Num[T]) ToFloat64(int32) float64 ( Num[T]) ToString(int32) string
Type Parameters: T: DecimalTypes Traits is a convenience for building generic objects for operating on Decimal values to get around the limitations of Go generics. By providing this interface a generic object can handle producing the proper types to generate new decimal values. ( Traits[T]) BytesRequired(int) int ( Traits[T]) FromFloat64(float64, int32, int32) (T, error) ( Traits[T]) FromString(string, int32, int32) (T, error) Traits : github.com/apache/arrow-go/v18/arrow.OffsetTraits Traits : github.com/apache/arrow-go/v18/internal/hashing.TypeTraits
Package-Level Functions (total 10)
func Decimal128FromString(v string, prec, scale int32) (n Decimal128, err error)
func Decimal256FromString(v string, prec, scale int32) (n Decimal256, err error)
Type Parameters: F: float32 | float64
func Decimal32FromString(v string, prec, scale int32) (n Decimal32, err error)
Type Parameters: F: float32 | float64
func Decimal64FromString(v string, prec, scale int32) (n Decimal64, err error)
Type Parameters: T: DecimalTypes
func PrecScaleFromString(s string) (prec, scale int32, err error)