dt

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 6 Imported by: 0

README

DT

This is a magical data structure set designed to unify the expression of various data types before Go generics were available.

This package defines several groups of interfaces and follows these conventions:

  • If an interface is named Interface, it must implement the AsInterface method

  • Child interfaces must implement all methods of their parent interfaces

  • Number - All numbers

    • Integer - All integers
      • Int - Signed integers
        • Int8
        • Int16
        • Int32
        • Int64
        • Int128
      • UInt - Unsigned integers
        • UInt8
        • UInt16
        • UInt32
        • UInt64
        • UInt128
    • Float - All floating-point numbers
    • BigDecimal (TODO)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidType = fmt.Errorf("invalid type")
View Source
var ErrTooLarge = fmt.Errorf("value too large")
View Source
var FloatEps = 1e-8 // tolerance

Functions

func CheckOverflowFloat

func CheckOverflowFloat(x float64, k reflect.Kind) bool

func CheckOverflowInt

func CheckOverflowInt(x int64, k reflect.Kind) bool