Documentation
¶
Overview ¶
Package decimal implements the bounded base-ten pipeline numeric contract.
Index ¶
- Constants
- Variables
- func ValidateDeclaration(precision, scale int) error
- type Value
- func (v Value) Cmp(other Value) int
- func (v Value) EstimatedBytes() int64
- func (v Value) Inexact() bool
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) Operation(other Value, operation string) (Value, error)
- func (v Value) Quantize(precision, scale int) (Value, error)
- func (v Value) Rat() *big.Rat
- func (v Value) Rounded() bool
- func (v Value) String() string
Constants ¶
View Source
const MaxPrecision = 38
Variables ¶
View Source
var ErrConversion = xerror.New(xerror.KindInvalidInput, "PIPELINE_DECIMAL_CONVERSION", "invalid bounded decimal conversion")
Functions ¶
func ValidateDeclaration ¶
Types ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is immutable; operations allocate a destination and never mutate operands. The zero value represents decimal zero.
func (Value) EstimatedBytes ¶
EstimatedBytes includes coefficient storage as well as the serialized token.
func (Value) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.