Documentation
¶
Index ¶
- Variables
- type LexoDecimal
- func (d *LexoDecimal) Add(other *LexoDecimal) *LexoDecimal
- func (d *LexoDecimal) Between(other *LexoDecimal) (*LexoDecimal, error)
- func (d *LexoDecimal) Ceil() *LexoInteger
- func (d *LexoDecimal) Compare(other *LexoDecimal) int
- func (d *LexoDecimal) Equals(other *LexoDecimal) bool
- func (d *LexoDecimal) Exact() bool
- func (d *LexoDecimal) Floor() *LexoInteger
- func (d *LexoDecimal) GetScale() int
- func (d *LexoDecimal) GetSystem() LexoNumeralSystem
- func (d *LexoDecimal) Multiply(other *LexoDecimal) *LexoDecimal
- func (d *LexoDecimal) SetScale(scale int) *LexoDecimal
- func (d *LexoDecimal) SetScaleWithCeiling(scale int) *LexoDecimal
- func (d *LexoDecimal) String() string
- func (d *LexoDecimal) Sub(other *LexoDecimal) *LexoDecimal
- type LexoInteger
- func (d *LexoInteger) Add(other *LexoInteger) (*LexoInteger, error)
- func (d *LexoInteger) Compare(other *LexoInteger) int
- func (d *LexoInteger) Equals(other *LexoInteger) bool
- func (d *LexoInteger) GetMag(idx int) byte
- func (d *LexoInteger) GetSystem() LexoNumeralSystem
- func (d *LexoInteger) IsZero() bool
- func (d *LexoInteger) Multiply(other *LexoInteger) (*LexoInteger, error)
- func (d *LexoInteger) ShiftLeft(times int) *LexoInteger
- func (d *LexoInteger) ShiftRight(times int) *LexoInteger
- func (d *LexoInteger) String() string
- func (d *LexoInteger) Sub(other *LexoInteger) (*LexoInteger, error)
- type LexoNumeralSystem
- type LexoNumeralSystem10
- func (n *LexoNumeralSystem10) Char(digit byte) byte
- func (n *LexoNumeralSystem10) Digit(ch byte) (byte, error)
- func (n *LexoNumeralSystem10) GetBase() byte
- func (n *LexoNumeralSystem10) GetNegativeChar() byte
- func (n *LexoNumeralSystem10) GetPositiveChar() byte
- func (n *LexoNumeralSystem10) GetRadixPointChar() byte
- type LexoNumeralSystem36
- func (n *LexoNumeralSystem36) Char(digit byte) byte
- func (n *LexoNumeralSystem36) Digit(ch byte) (byte, error)
- func (n *LexoNumeralSystem36) GetBase() byte
- func (n *LexoNumeralSystem36) GetNegativeChar() byte
- func (n *LexoNumeralSystem36) GetPositiveChar() byte
- func (n *LexoNumeralSystem36) GetRadixPointChar() byte
- type LexoNumeralSystem64
- func (n *LexoNumeralSystem64) Char(digit byte) byte
- func (n *LexoNumeralSystem64) Digit(ch byte) (byte, error)
- func (n *LexoNumeralSystem64) GetBase() byte
- func (n *LexoNumeralSystem64) GetNegativeChar() byte
- func (n *LexoNumeralSystem64) GetPositiveChar() byte
- func (n *LexoNumeralSystem64) GetRadixPointChar() byte
- type LexoRank
- type LexoRankBucket
Constants ¶
This section is empty.
Variables ¶
View Source
var (
LexoRankBucket0, _ = NewLexoRankBucket("0")
LexoRankBucket1, _ = NewLexoRankBucket("1")
LexoRankBucket2, _ = NewLexoRankBucket("2")
LexoRankBuckets = []*LexoRankBucket{LexoRankBucket0, LexoRankBucket1, LexoRankBucket2}
)
View Source
var ( LexoRankSystem = NewLexoNumeralSystem36() MinLexoRank = NewLexoRank(LexoRankBucket0, minDecimal) MaxLexoRank = NewLexoRank(LexoRankBucket0, maxDecimal) MidLexoRank, _ = MinLexoRank.Between(MaxLexoRank) )
View Source
var (
DifferentBaseErr = errors.New("expected numbers of same numeral sys")
)
Functions ¶
This section is empty.
Types ¶
type LexoDecimal ¶
type LexoDecimal struct {
// contains filtered or unexported fields
}
func LexoDecimalMake ¶
func LexoDecimalMake(i *LexoInteger, scale int) *LexoDecimal
func LexoDecimalParse ¶
func LexoDecimalParse(str string, system LexoNumeralSystem) (*LexoDecimal, error)
func NewLexoDecimal ¶
func NewLexoDecimal(mag *LexoInteger, scale int) *LexoDecimal
func (*LexoDecimal) Add ¶
func (d *LexoDecimal) Add(other *LexoDecimal) *LexoDecimal
func (*LexoDecimal) Between ¶
func (d *LexoDecimal) Between(other *LexoDecimal) (*LexoDecimal, error)
func (*LexoDecimal) Ceil ¶
func (d *LexoDecimal) Ceil() *LexoInteger
func (*LexoDecimal) Compare ¶
func (d *LexoDecimal) Compare(other *LexoDecimal) int
func (*LexoDecimal) Equals ¶
func (d *LexoDecimal) Equals(other *LexoDecimal) bool
func (*LexoDecimal) Exact ¶
func (d *LexoDecimal) Exact() bool
func (*LexoDecimal) Floor ¶
func (d *LexoDecimal) Floor() *LexoInteger
func (*LexoDecimal) GetScale ¶
func (d *LexoDecimal) GetScale() int
func (*LexoDecimal) GetSystem ¶
func (d *LexoDecimal) GetSystem() LexoNumeralSystem
func (*LexoDecimal) Multiply ¶
func (d *LexoDecimal) Multiply(other *LexoDecimal) *LexoDecimal
func (*LexoDecimal) SetScale ¶
func (d *LexoDecimal) SetScale(scale int) *LexoDecimal
func (*LexoDecimal) SetScaleWithCeiling ¶
func (d *LexoDecimal) SetScaleWithCeiling(scale int) *LexoDecimal
func (*LexoDecimal) String ¶
func (d *LexoDecimal) String() string
func (*LexoDecimal) Sub ¶
func (d *LexoDecimal) Sub(other *LexoDecimal) *LexoDecimal
type LexoInteger ¶
type LexoInteger struct {
// contains filtered or unexported fields
}
func LexoIntegerParse ¶
func LexoIntegerParse(strFull string, system LexoNumeralSystem) (*LexoInteger, error)
func NewLexoInteger ¶
func NewLexoInteger(sys LexoNumeralSystem, sign int, mag []byte) *LexoInteger
func (*LexoInteger) Add ¶
func (d *LexoInteger) Add(other *LexoInteger) (*LexoInteger, error)
func (*LexoInteger) Compare ¶
func (d *LexoInteger) Compare(other *LexoInteger) int
func (*LexoInteger) Equals ¶
func (d *LexoInteger) Equals(other *LexoInteger) bool
func (*LexoInteger) GetMag ¶
func (d *LexoInteger) GetMag(idx int) byte
func (*LexoInteger) GetSystem ¶
func (d *LexoInteger) GetSystem() LexoNumeralSystem
func (*LexoInteger) IsZero ¶
func (d *LexoInteger) IsZero() bool
func (*LexoInteger) Multiply ¶
func (d *LexoInteger) Multiply(other *LexoInteger) (*LexoInteger, error)
func (*LexoInteger) ShiftLeft ¶
func (d *LexoInteger) ShiftLeft(times int) *LexoInteger
func (*LexoInteger) ShiftRight ¶
func (d *LexoInteger) ShiftRight(times int) *LexoInteger
func (*LexoInteger) String ¶
func (d *LexoInteger) String() string
func (*LexoInteger) Sub ¶
func (d *LexoInteger) Sub(other *LexoInteger) (*LexoInteger, error)
type LexoNumeralSystem ¶
type LexoNumeralSystem interface { GetBase() byte GetPositiveChar() byte GetNegativeChar() byte GetRadixPointChar() byte Digit(ch byte) (byte, error) Char(digit byte) byte }
func NewLexoNumeralSystem36 ¶
func NewLexoNumeralSystem36() LexoNumeralSystem
type LexoNumeralSystem10 ¶
type LexoNumeralSystem10 struct { }
func NewLexoNumeralSystem10 ¶
func NewLexoNumeralSystem10() *LexoNumeralSystem10
func (*LexoNumeralSystem10) Char ¶
func (n *LexoNumeralSystem10) Char(digit byte) byte
func (*LexoNumeralSystem10) GetBase ¶
func (n *LexoNumeralSystem10) GetBase() byte
func (*LexoNumeralSystem10) GetNegativeChar ¶
func (n *LexoNumeralSystem10) GetNegativeChar() byte
func (*LexoNumeralSystem10) GetPositiveChar ¶
func (n *LexoNumeralSystem10) GetPositiveChar() byte
func (*LexoNumeralSystem10) GetRadixPointChar ¶
func (n *LexoNumeralSystem10) GetRadixPointChar() byte
type LexoNumeralSystem36 ¶
type LexoNumeralSystem36 struct { }
func (*LexoNumeralSystem36) Char ¶
func (n *LexoNumeralSystem36) Char(digit byte) byte
func (*LexoNumeralSystem36) GetBase ¶
func (n *LexoNumeralSystem36) GetBase() byte
func (*LexoNumeralSystem36) GetNegativeChar ¶
func (n *LexoNumeralSystem36) GetNegativeChar() byte
func (*LexoNumeralSystem36) GetPositiveChar ¶
func (n *LexoNumeralSystem36) GetPositiveChar() byte
func (*LexoNumeralSystem36) GetRadixPointChar ¶
func (n *LexoNumeralSystem36) GetRadixPointChar() byte
type LexoNumeralSystem64 ¶
type LexoNumeralSystem64 struct { }
func NewLexoNumeralSystem64 ¶
func NewLexoNumeralSystem64() *LexoNumeralSystem64
func (*LexoNumeralSystem64) Char ¶
func (n *LexoNumeralSystem64) Char(digit byte) byte
func (*LexoNumeralSystem64) GetBase ¶
func (n *LexoNumeralSystem64) GetBase() byte
func (*LexoNumeralSystem64) GetNegativeChar ¶
func (n *LexoNumeralSystem64) GetNegativeChar() byte
func (*LexoNumeralSystem64) GetPositiveChar ¶
func (n *LexoNumeralSystem64) GetPositiveChar() byte
func (*LexoNumeralSystem64) GetRadixPointChar ¶
func (n *LexoNumeralSystem64) GetRadixPointChar() byte
type LexoRank ¶
type LexoRank struct {
// contains filtered or unexported fields
}
func LexoRankParse ¶
func NewLexoRank ¶
func NewLexoRank(bucket *LexoRankBucket, decimal *LexoDecimal) *LexoRank
type LexoRankBucket ¶
type LexoRankBucket struct {
// contains filtered or unexported fields
}
func NewLexoRankBucket ¶
func NewLexoRankBucket(str string) (*LexoRankBucket, error)
func (*LexoRankBucket) Equals ¶
func (b *LexoRankBucket) Equals(other *LexoRankBucket) bool
func (*LexoRankBucket) String ¶
func (b *LexoRankBucket) String() string
Click to show internal directories.
Click to hide internal directories.