Documentation
¶
Overview ¶
Package fixed provides fixed-point values that can be added, subtracted, multiplied and divided.
Index ¶
- Constants
- Variables
- type F128d16
- func (f F128d16) Add(value F128d16) F128d16
- func (f F128d16) AsFloat32() float32
- func (f F128d16) AsFloat64() float64
- func (f F128d16) AsInt() int
- func (f F128d16) AsInt64() int64
- func (f F128d16) Comma() string
- func (f F128d16) CommaWithSign() string
- func (f F128d16) Div(value F128d16) F128d16
- func (f F128d16) Float32() (float32, error)
- func (f F128d16) Float64() (float64, error)
- func (f F128d16) Int() (int, error)
- func (f F128d16) Int64() (int64, error)
- func (f F128d16) MarshalJSON() ([]byte, error)
- func (f F128d16) MarshalText() ([]byte, error)
- func (f F128d16) MarshalYAML() (interface{}, error)
- func (f F128d16) Max(value F128d16) F128d16
- func (f F128d16) Min(value F128d16) F128d16
- func (f F128d16) Mul(value F128d16) F128d16
- func (f F128d16) String() string
- func (f F128d16) StringWithSign() string
- func (f F128d16) Sub(value F128d16) F128d16
- func (f F128d16) Trunc() F128d16
- func (f *F128d16) UnmarshalJSON(in []byte) error
- func (f *F128d16) UnmarshalText(text []byte) error
- func (f *F128d16) UnmarshalYAML(unmarshal func(interface{}) error) error
- type F128d2
- func (f F128d2) Add(value F128d2) F128d2
- func (f F128d2) AsFloat32() float32
- func (f F128d2) AsFloat64() float64
- func (f F128d2) AsInt() int
- func (f F128d2) AsInt64() int64
- func (f F128d2) Comma() string
- func (f F128d2) CommaWithSign() string
- func (f F128d2) Div(value F128d2) F128d2
- func (f F128d2) Float32() (float32, error)
- func (f F128d2) Float64() (float64, error)
- func (f F128d2) Int() (int, error)
- func (f F128d2) Int64() (int64, error)
- func (f F128d2) MarshalJSON() ([]byte, error)
- func (f F128d2) MarshalText() ([]byte, error)
- func (f F128d2) MarshalYAML() (interface{}, error)
- func (f F128d2) Max(value F128d2) F128d2
- func (f F128d2) Min(value F128d2) F128d2
- func (f F128d2) Mul(value F128d2) F128d2
- func (f F128d2) String() string
- func (f F128d2) StringWithSign() string
- func (f F128d2) Sub(value F128d2) F128d2
- func (f F128d2) Trunc() F128d2
- func (f *F128d2) UnmarshalJSON(in []byte) error
- func (f *F128d2) UnmarshalText(text []byte) error
- func (f *F128d2) UnmarshalYAML(unmarshal func(interface{}) error) error
- type F128d3
- func (f F128d3) Add(value F128d3) F128d3
- func (f F128d3) AsFloat32() float32
- func (f F128d3) AsFloat64() float64
- func (f F128d3) AsInt() int
- func (f F128d3) AsInt64() int64
- func (f F128d3) Comma() string
- func (f F128d3) CommaWithSign() string
- func (f F128d3) Div(value F128d3) F128d3
- func (f F128d3) Float32() (float32, error)
- func (f F128d3) Float64() (float64, error)
- func (f F128d3) Int() (int, error)
- func (f F128d3) Int64() (int64, error)
- func (f F128d3) MarshalJSON() ([]byte, error)
- func (f F128d3) MarshalText() ([]byte, error)
- func (f F128d3) MarshalYAML() (interface{}, error)
- func (f F128d3) Max(value F128d3) F128d3
- func (f F128d3) Min(value F128d3) F128d3
- func (f F128d3) Mul(value F128d3) F128d3
- func (f F128d3) String() string
- func (f F128d3) StringWithSign() string
- func (f F128d3) Sub(value F128d3) F128d3
- func (f F128d3) Trunc() F128d3
- func (f *F128d3) UnmarshalJSON(in []byte) error
- func (f *F128d3) UnmarshalText(text []byte) error
- func (f *F128d3) UnmarshalYAML(unmarshal func(interface{}) error) error
- type F128d4
- func (f F128d4) Add(value F128d4) F128d4
- func (f F128d4) AsFloat32() float32
- func (f F128d4) AsFloat64() float64
- func (f F128d4) AsInt() int
- func (f F128d4) AsInt64() int64
- func (f F128d4) Comma() string
- func (f F128d4) CommaWithSign() string
- func (f F128d4) Div(value F128d4) F128d4
- func (f F128d4) Float32() (float32, error)
- func (f F128d4) Float64() (float64, error)
- func (f F128d4) Int() (int, error)
- func (f F128d4) Int64() (int64, error)
- func (f F128d4) MarshalJSON() ([]byte, error)
- func (f F128d4) MarshalText() ([]byte, error)
- func (f F128d4) MarshalYAML() (interface{}, error)
- func (f F128d4) Max(value F128d4) F128d4
- func (f F128d4) Min(value F128d4) F128d4
- func (f F128d4) Mul(value F128d4) F128d4
- func (f F128d4) String() string
- func (f F128d4) StringWithSign() string
- func (f F128d4) Sub(value F128d4) F128d4
- func (f F128d4) Trunc() F128d4
- func (f *F128d4) UnmarshalJSON(in []byte) error
- func (f *F128d4) UnmarshalText(text []byte) error
- func (f *F128d4) UnmarshalYAML(unmarshal func(interface{}) error) error
- type F128d6
- func (f F128d6) Add(value F128d6) F128d6
- func (f F128d6) AsFloat32() float32
- func (f F128d6) AsFloat64() float64
- func (f F128d6) AsInt() int
- func (f F128d6) AsInt64() int64
- func (f F128d6) Comma() string
- func (f F128d6) CommaWithSign() string
- func (f F128d6) Div(value F128d6) F128d6
- func (f F128d6) Float32() (float32, error)
- func (f F128d6) Float64() (float64, error)
- func (f F128d6) Int() (int, error)
- func (f F128d6) Int64() (int64, error)
- func (f F128d6) MarshalJSON() ([]byte, error)
- func (f F128d6) MarshalText() ([]byte, error)
- func (f F128d6) MarshalYAML() (interface{}, error)
- func (f F128d6) Max(value F128d6) F128d6
- func (f F128d6) Min(value F128d6) F128d6
- func (f F128d6) Mul(value F128d6) F128d6
- func (f F128d6) String() string
- func (f F128d6) StringWithSign() string
- func (f F128d6) Sub(value F128d6) F128d6
- func (f F128d6) Trunc() F128d6
- func (f *F128d6) UnmarshalJSON(in []byte) error
- func (f *F128d6) UnmarshalText(text []byte) error
- func (f *F128d6) UnmarshalYAML(unmarshal func(interface{}) error) error
- type F64d2
- func (f F64d2) AsFloat32() float32
- func (f F64d2) AsFloat64() float64
- func (f F64d2) AsInt() int
- func (f F64d2) AsInt64() int64
- func (f F64d2) Comma() string
- func (f F64d2) CommaWithSign() string
- func (f F64d2) Div(value F64d2) F64d2
- func (f F64d2) Float32() (float32, error)
- func (f F64d2) Float64() (float64, error)
- func (f F64d2) Int() (int, error)
- func (f F64d2) Int64() (int64, error)
- func (f F64d2) MarshalJSON() ([]byte, error)
- func (f F64d2) MarshalText() ([]byte, error)
- func (f F64d2) MarshalYAML() (interface{}, error)
- func (f F64d2) Max(value F64d2) F64d2
- func (f F64d2) Min(value F64d2) F64d2
- func (f F64d2) Mul(value F64d2) F64d2
- func (f F64d2) String() string
- func (f F64d2) StringWithSign() string
- func (f F64d2) Trunc() F64d2
- func (f *F64d2) UnmarshalJSON(in []byte) error
- func (f *F64d2) UnmarshalText(text []byte) error
- func (f *F64d2) UnmarshalYAML(unmarshal func(interface{}) error) error
- type F64d3
- func (f F64d3) AsFloat32() float32
- func (f F64d3) AsFloat64() float64
- func (f F64d3) AsInt() int
- func (f F64d3) AsInt64() int64
- func (f F64d3) Comma() string
- func (f F64d3) CommaWithSign() string
- func (f F64d3) Div(value F64d3) F64d3
- func (f F64d3) Float32() (float32, error)
- func (f F64d3) Float64() (float64, error)
- func (f F64d3) Int() (int, error)
- func (f F64d3) Int64() (int64, error)
- func (f F64d3) MarshalJSON() ([]byte, error)
- func (f F64d3) MarshalText() ([]byte, error)
- func (f F64d3) MarshalYAML() (interface{}, error)
- func (f F64d3) Max(value F64d3) F64d3
- func (f F64d3) Min(value F64d3) F64d3
- func (f F64d3) Mul(value F64d3) F64d3
- func (f F64d3) String() string
- func (f F64d3) StringWithSign() string
- func (f F64d3) Trunc() F64d3
- func (f *F64d3) UnmarshalJSON(in []byte) error
- func (f *F64d3) UnmarshalText(text []byte) error
- func (f *F64d3) UnmarshalYAML(unmarshal func(interface{}) error) error
- type F64d4
- func (f F64d4) AsFloat32() float32
- func (f F64d4) AsFloat64() float64
- func (f F64d4) AsInt() int
- func (f F64d4) AsInt64() int64
- func (f F64d4) Comma() string
- func (f F64d4) CommaWithSign() string
- func (f F64d4) Div(value F64d4) F64d4
- func (f F64d4) Float32() (float32, error)
- func (f F64d4) Float64() (float64, error)
- func (f F64d4) Int() (int, error)
- func (f F64d4) Int64() (int64, error)
- func (f F64d4) MarshalJSON() ([]byte, error)
- func (f F64d4) MarshalText() ([]byte, error)
- func (f F64d4) MarshalYAML() (interface{}, error)
- func (f F64d4) Max(value F64d4) F64d4
- func (f F64d4) Min(value F64d4) F64d4
- func (f F64d4) Mul(value F64d4) F64d4
- func (f F64d4) String() string
- func (f F64d4) StringWithSign() string
- func (f F64d4) Trunc() F64d4
- func (f *F64d4) UnmarshalJSON(in []byte) error
- func (f *F64d4) UnmarshalText(text []byte) error
- func (f *F64d4) UnmarshalYAML(unmarshal func(interface{}) error) error
- type F64d6
- func (f F64d6) AsFloat32() float32
- func (f F64d6) AsFloat64() float64
- func (f F64d6) AsInt() int
- func (f F64d6) AsInt64() int64
- func (f F64d6) Comma() string
- func (f F64d6) CommaWithSign() string
- func (f F64d6) Div(value F64d6) F64d6
- func (f F64d6) Float32() (float32, error)
- func (f F64d6) Float64() (float64, error)
- func (f F64d6) Int() (int, error)
- func (f F64d6) Int64() (int64, error)
- func (f F64d6) MarshalJSON() ([]byte, error)
- func (f F64d6) MarshalText() ([]byte, error)
- func (f F64d6) MarshalYAML() (interface{}, error)
- func (f F64d6) Max(value F64d6) F64d6
- func (f F64d6) Min(value F64d6) F64d6
- func (f F64d6) Mul(value F64d6) F64d6
- func (f F64d6) String() string
- func (f F64d6) StringWithSign() string
- func (f F64d6) Trunc() F64d6
- func (f *F64d6) UnmarshalJSON(in []byte) error
- func (f *F64d6) UnmarshalText(text []byte) error
- func (f *F64d6) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
const ( // F64d2Max holds the maximum F64d2 value. F64d2Max = F64d2(1<<63 - 1) // F64d2Min holds the minimum F64d2 value. F64d2Min = F64d2(^(1<<63 - 1)) )
const ( // F64d3Max holds the maximum F64d3 value. F64d3Max = F64d3(1<<63 - 1) // F64d3Min holds the minimum F64d3 value. F64d3Min = F64d3(^(1<<63 - 1)) )
const ( // F64d4Max holds the maximum F64d4 value. F64d4Max = F64d4(1<<63 - 1) // F64d4Min holds the minimum F64d4 value. F64d4Min = F64d4(^(1<<63 - 1)) )
const ( // F64d6Max holds the maximum F64d6 value. F64d6Max = F64d6(1<<63 - 1) // F64d6Min holds the minimum F64d6 value. F64d6Min = F64d6(^(1<<63 - 1)) )
Variables ¶
var ( // F128d16Max holds the maximum F128d16 value. F128d16Max = F128d16{/* contains filtered or unexported fields */} // F128d16Min holds the minimum F128d16 value. F128d16Min = F128d16{/* contains filtered or unexported fields */} )
var ( // F128d2Max holds the maximum F128d2 value. F128d2Max = F128d2{/* contains filtered or unexported fields */} // F128d2Min holds the minimum F128d2 value. F128d2Min = F128d2{/* contains filtered or unexported fields */} )
var ( // F128d3Max holds the maximum F128d3 value. F128d3Max = F128d3{/* contains filtered or unexported fields */} // F128d3Min holds the minimum F128d3 value. F128d3Min = F128d3{/* contains filtered or unexported fields */} )
var ( // F128d4Max holds the maximum F128d4 value. F128d4Max = F128d4{/* contains filtered or unexported fields */} // F128d4Min holds the minimum F128d4 value. F128d4Min = F128d4{/* contains filtered or unexported fields */} )
var ( // F128d6Max holds the maximum F128d6 value. F128d6Max = F128d6{/* contains filtered or unexported fields */} // F128d6Min holds the minimum F128d6 value. F128d6Min = F128d6{/* contains filtered or unexported fields */} )
Functions ¶
This section is empty.
Types ¶
type F128d16 ¶ added in v1.9.0
type F128d16 struct {
// contains filtered or unexported fields
}
F128d16 holds a fixed-point value that contains up to 16 decimal places. Values are truncated, not rounded.
func F128d16FromFloat32 ¶ added in v1.61.0
F128d16FromFloat32 creates a new F128d16 value from a float32.
func F128d16FromFloat64 ¶ added in v1.9.0
F128d16FromFloat64 creates a new F128d16 value from a float64.
func F128d16FromInt ¶ added in v1.61.0
F128d16FromInt creates a new F128d16 value from an int.
func F128d16FromInt64 ¶ added in v1.9.0
F128d16FromInt64 creates a new F128d16 value from an int64.
func F128d16FromString ¶ added in v1.9.0
F128d16FromString creates a new F128d16 value from a string.
func F128d16FromStringForced ¶ added in v1.9.0
F128d16FromStringForced creates a new F128d16 value from a string.
func (F128d16) Add ¶ added in v1.9.0
Add adds this value to the passed-in value, returning a new value.
func (F128d16) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F128d16) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F128d16) AsInt ¶ added in v1.61.0
AsInt returns the truncated equivalent integer to this value.
func (F128d16) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F128d16) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F128d16) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F128d16) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F128d16) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F128d16) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F128d16) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F128d16) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F128d16) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F128d16) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F128d16) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F128d16) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F128d16) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F128d16) Sub ¶ added in v1.9.0
Sub subtracts the passed-in value from this value, returning a new value.
func (F128d16) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F128d16) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F128d16) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F128d16) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.
type F128d2 ¶ added in v1.9.0
type F128d2 struct {
// contains filtered or unexported fields
}
F128d2 holds a fixed-point value that contains up to 2 decimal places. Values are truncated, not rounded.
func F128d2FromFloat32 ¶ added in v1.61.0
F128d2FromFloat32 creates a new F128d2 value from a float32.
func F128d2FromFloat64 ¶ added in v1.9.0
F128d2FromFloat64 creates a new F128d2 value from a float64.
func F128d2FromInt ¶ added in v1.61.0
F128d2FromInt creates a new F128d2 value from an int.
func F128d2FromInt64 ¶ added in v1.9.0
F128d2FromInt64 creates a new F128d2 value from an int64.
func F128d2FromString ¶ added in v1.9.0
F128d2FromString creates a new F128d2 value from a string.
func F128d2FromStringForced ¶ added in v1.9.0
F128d2FromStringForced creates a new F128d2 value from a string.
func (F128d2) Add ¶ added in v1.9.0
Add adds this value to the passed-in value, returning a new value.
func (F128d2) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F128d2) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F128d2) AsInt ¶ added in v1.61.0
AsInt returns the truncated equivalent integer to this value.
func (F128d2) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F128d2) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F128d2) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F128d2) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F128d2) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F128d2) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F128d2) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F128d2) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F128d2) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F128d2) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F128d2) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F128d2) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F128d2) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F128d2) Sub ¶ added in v1.9.0
Sub subtracts the passed-in value from this value, returning a new value.
func (F128d2) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F128d2) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F128d2) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F128d2) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.
type F128d3 ¶ added in v1.9.0
type F128d3 struct {
// contains filtered or unexported fields
}
F128d3 holds a fixed-point value that contains up to 3 decimal places. Values are truncated, not rounded.
func F128d3FromFloat32 ¶ added in v1.61.0
F128d3FromFloat32 creates a new F128d3 value from a float32.
func F128d3FromFloat64 ¶ added in v1.9.0
F128d3FromFloat64 creates a new F128d3 value from a float64.
func F128d3FromInt ¶ added in v1.61.0
F128d3FromInt creates a new F128d3 value from an int.
func F128d3FromInt64 ¶ added in v1.9.0
F128d3FromInt64 creates a new F128d3 value from an int64.
func F128d3FromString ¶ added in v1.9.0
F128d3FromString creates a new F128d3 value from a string.
func F128d3FromStringForced ¶ added in v1.9.0
F128d3FromStringForced creates a new F128d3 value from a string.
func (F128d3) Add ¶ added in v1.9.0
Add adds this value to the passed-in value, returning a new value.
func (F128d3) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F128d3) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F128d3) AsInt ¶ added in v1.61.0
AsInt returns the truncated equivalent integer to this value.
func (F128d3) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F128d3) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F128d3) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F128d3) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F128d3) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F128d3) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F128d3) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F128d3) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F128d3) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F128d3) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F128d3) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F128d3) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F128d3) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F128d3) Sub ¶ added in v1.9.0
Sub subtracts the passed-in value from this value, returning a new value.
func (F128d3) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F128d3) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F128d3) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F128d3) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.
type F128d4 ¶ added in v1.9.0
type F128d4 struct {
// contains filtered or unexported fields
}
F128d4 holds a fixed-point value that contains up to 4 decimal places. Values are truncated, not rounded.
func F128d4FromFloat32 ¶ added in v1.61.0
F128d4FromFloat32 creates a new F128d4 value from a float32.
func F128d4FromFloat64 ¶ added in v1.9.0
F128d4FromFloat64 creates a new F128d4 value from a float64.
func F128d4FromInt ¶ added in v1.61.0
F128d4FromInt creates a new F128d4 value from an int.
func F128d4FromInt64 ¶ added in v1.9.0
F128d4FromInt64 creates a new F128d4 value from an int64.
func F128d4FromString ¶ added in v1.9.0
F128d4FromString creates a new F128d4 value from a string.
func F128d4FromStringForced ¶ added in v1.9.0
F128d4FromStringForced creates a new F128d4 value from a string.
func (F128d4) Add ¶ added in v1.9.0
Add adds this value to the passed-in value, returning a new value.
func (F128d4) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F128d4) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F128d4) AsInt ¶ added in v1.61.0
AsInt returns the truncated equivalent integer to this value.
func (F128d4) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F128d4) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F128d4) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F128d4) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F128d4) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F128d4) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F128d4) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F128d4) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F128d4) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F128d4) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F128d4) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F128d4) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F128d4) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F128d4) Sub ¶ added in v1.9.0
Sub subtracts the passed-in value from this value, returning a new value.
func (F128d4) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F128d4) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F128d4) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F128d4) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.
type F128d6 ¶ added in v1.9.0
type F128d6 struct {
// contains filtered or unexported fields
}
F128d6 holds a fixed-point value that contains up to 6 decimal places. Values are truncated, not rounded.
func F128d6FromFloat32 ¶ added in v1.61.0
F128d6FromFloat32 creates a new F128d6 value from a float32.
func F128d6FromFloat64 ¶ added in v1.9.0
F128d6FromFloat64 creates a new F128d6 value from a float64.
func F128d6FromInt ¶ added in v1.61.0
F128d6FromInt creates a new F128d6 value from an int.
func F128d6FromInt64 ¶ added in v1.9.0
F128d6FromInt64 creates a new F128d6 value from an int64.
func F128d6FromString ¶ added in v1.9.0
F128d6FromString creates a new F128d6 value from a string.
func F128d6FromStringForced ¶ added in v1.9.0
F128d6FromStringForced creates a new F128d6 value from a string.
func (F128d6) Add ¶ added in v1.9.0
Add adds this value to the passed-in value, returning a new value.
func (F128d6) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F128d6) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F128d6) AsInt ¶ added in v1.61.0
AsInt returns the truncated equivalent integer to this value.
func (F128d6) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F128d6) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F128d6) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F128d6) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F128d6) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F128d6) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F128d6) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F128d6) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F128d6) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F128d6) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F128d6) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F128d6) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F128d6) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F128d6) Sub ¶ added in v1.9.0
Sub subtracts the passed-in value from this value, returning a new value.
func (F128d6) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F128d6) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F128d6) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F128d6) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.
type F64d2 ¶ added in v1.9.0
type F64d2 int64
F64d2 holds a fixed-point value that contains up to 2 decimal places. Values are truncated, not rounded. Values can be added and subtracted directly. For multiplication and division, the provided Mul() and Div() methods should be used.
func F64d2FromFloat32 ¶ added in v1.61.0
F64d2FromFloat32 creates a new F64d2 value from a float32.
func F64d2FromFloat64 ¶ added in v1.9.0
F64d2FromFloat64 creates a new F64d2 value from a float64.
func F64d2FromInt ¶ added in v1.61.0
F64d2FromInt creates a new F64d2 value from an int.
func F64d2FromInt64 ¶ added in v1.9.0
F64d2FromInt64 creates a new F64d2 value from an int64.
func F64d2FromString ¶ added in v1.9.0
F64d2FromString creates a new F64d2 value from a string.
func F64d2FromStringForced ¶ added in v1.9.0
F64d2FromStringForced creates a new F64d2 value from a string.
func (F64d2) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F64d2) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F64d2) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F64d2) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F64d2) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F64d2) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F64d2) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F64d2) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F64d2) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F64d2) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F64d2) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F64d2) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F64d2) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F64d2) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F64d2) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F64d2) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F64d2) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F64d2) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F64d2) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.
type F64d3 ¶ added in v1.9.0
type F64d3 int64
F64d3 holds a fixed-point value that contains up to 3 decimal places. Values are truncated, not rounded. Values can be added and subtracted directly. For multiplication and division, the provided Mul() and Div() methods should be used.
func F64d3FromFloat32 ¶ added in v1.61.0
F64d3FromFloat32 creates a new F64d3 value from a float32.
func F64d3FromFloat64 ¶ added in v1.9.0
F64d3FromFloat64 creates a new F64d3 value from a float64.
func F64d3FromInt ¶ added in v1.61.0
F64d3FromInt creates a new F64d3 value from an int.
func F64d3FromInt64 ¶ added in v1.9.0
F64d3FromInt64 creates a new F64d3 value from an int64.
func F64d3FromString ¶ added in v1.9.0
F64d3FromString creates a new F64d3 value from a string.
func F64d3FromStringForced ¶ added in v1.9.0
F64d3FromStringForced creates a new F64d3 value from a string.
func (F64d3) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F64d3) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F64d3) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F64d3) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F64d3) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F64d3) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F64d3) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F64d3) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F64d3) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F64d3) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F64d3) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F64d3) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F64d3) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F64d3) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F64d3) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F64d3) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F64d3) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F64d3) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F64d3) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.
type F64d4 ¶ added in v1.9.0
type F64d4 int64
F64d4 holds a fixed-point value that contains up to 4 decimal places. Values are truncated, not rounded. Values can be added and subtracted directly. For multiplication and division, the provided Mul() and Div() methods should be used.
func F64d4FromFloat32 ¶ added in v1.61.0
F64d4FromFloat32 creates a new F64d4 value from a float32.
func F64d4FromFloat64 ¶ added in v1.9.0
F64d4FromFloat64 creates a new F64d4 value from a float64.
func F64d4FromInt ¶ added in v1.61.0
F64d4FromInt creates a new F64d4 value from an int.
func F64d4FromInt64 ¶ added in v1.9.0
F64d4FromInt64 creates a new F64d4 value from an int64.
func F64d4FromString ¶ added in v1.9.0
F64d4FromString creates a new F64d4 value from a string.
func F64d4FromStringForced ¶ added in v1.9.0
F64d4FromStringForced creates a new F64d4 value from a string.
func (F64d4) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F64d4) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F64d4) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F64d4) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F64d4) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F64d4) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F64d4) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F64d4) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F64d4) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F64d4) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F64d4) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F64d4) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F64d4) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F64d4) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F64d4) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F64d4) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F64d4) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F64d4) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F64d4) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.
type F64d6 ¶ added in v1.9.0
type F64d6 int64
F64d6 holds a fixed-point value that contains up to 6 decimal places. Values are truncated, not rounded. Values can be added and subtracted directly. For multiplication and division, the provided Mul() and Div() methods should be used.
func F64d6FromFloat32 ¶ added in v1.61.0
F64d6FromFloat32 creates a new F64d6 value from a float32.
func F64d6FromFloat64 ¶ added in v1.9.0
F64d6FromFloat64 creates a new F64d6 value from a float64.
func F64d6FromInt ¶ added in v1.61.0
F64d6FromInt creates a new F64d6 value from an int.
func F64d6FromInt64 ¶ added in v1.9.0
F64d6FromInt64 creates a new F64d6 value from an int64.
func F64d6FromString ¶ added in v1.9.0
F64d6FromString creates a new F64d6 value from a string.
func F64d6FromStringForced ¶ added in v1.9.0
F64d6FromStringForced creates a new F64d6 value from a string.
func (F64d6) AsFloat32 ¶ added in v1.61.0
AsFloat32 returns the floating-point equivalent to this value.
func (F64d6) AsFloat64 ¶ added in v1.9.2
AsFloat64 returns the floating-point equivalent to this value.
func (F64d6) AsInt64 ¶ added in v1.9.2
AsInt64 returns the truncated equivalent integer to this value.
func (F64d6) Comma ¶ added in v1.9.0
Comma returns the same as String(), but with commas for values of 1000 and greater.
func (F64d6) CommaWithSign ¶ added in v1.58.0
CommaWithSign returns the same as Comma(), but prefixes the value with a '+' if it is positive
func (F64d6) Div ¶ added in v1.9.0
Div divides this value by the passed-in value, returning a new value.
func (F64d6) Float32 ¶ added in v1.61.0
Float32 is the same as AsFloat32(), except that it returns an error if the value cannot be represented exactly with a float32.
func (F64d6) Float64 ¶ added in v1.9.0
Float64 is the same as AsFloat64(), except that it returns an error if the value cannot be represented exactly with a float64.
func (F64d6) Int ¶ added in v1.61.0
Int is the same as AsInt(), except that it returns an error if the value cannot be represented exactly with an int.
func (F64d6) Int64 ¶ added in v1.9.0
Int64 is the same as AsInt64(), except that it returns an error if the value cannot be represented exactly with an int64.
func (F64d6) MarshalJSON ¶ added in v1.9.0
MarshalJSON implements json.Marshaler.
func (F64d6) MarshalText ¶ added in v1.9.0
MarshalText implements the encoding.TextMarshaler interface.
func (F64d6) MarshalYAML ¶ added in v1.9.0
MarshalYAML implements yaml.Marshaler.
func (F64d6) Mul ¶ added in v1.9.0
Mul multiplies this value by the passed-in value, returning a new value.
func (F64d6) StringWithSign ¶ added in v1.58.0
StringWithSign returns the same as String(), but prefixes the value with a '+' if it is positive
func (F64d6) Trunc ¶ added in v1.9.0
Trunc returns a new value which has everything to the right of the decimal place truncated.
func (*F64d6) UnmarshalJSON ¶ added in v1.9.0
UnmarshalJSON implements json.Unmarshaler.
func (*F64d6) UnmarshalText ¶ added in v1.9.0
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*F64d6) UnmarshalYAML ¶ added in v1.9.0
UnmarshalYAML implements yaml.Unmarshaler.