github.com/goplus/gossa@v0.3.25/pkg/math/go116_export.go (about)

     1  // export by github.com/goplus/gossa/cmd/qexp
     2  
     3  //+build go1.16,!go1.17
     4  
     5  package math
     6  
     7  import (
     8  	q "math"
     9  
    10  	"go/constant"
    11  	"go/token"
    12  	"reflect"
    13  
    14  	"github.com/goplus/gossa"
    15  )
    16  
    17  func init() {
    18  	gossa.RegisterPackage(&gossa.Package{
    19  		Name: "math",
    20  		Path: "math",
    21  		Deps: map[string]string{
    22  			"internal/cpu": "cpu",
    23  			"math/bits":    "bits",
    24  			"unsafe":       "unsafe",
    25  		},
    26  		Interfaces: map[string]reflect.Type{},
    27  		NamedTypes: map[string]gossa.NamedType{},
    28  		AliasTypes: map[string]reflect.Type{},
    29  		Vars:       map[string]reflect.Value{},
    30  		Funcs: map[string]reflect.Value{
    31  			"Abs":             reflect.ValueOf(q.Abs),
    32  			"Acos":            reflect.ValueOf(q.Acos),
    33  			"Acosh":           reflect.ValueOf(q.Acosh),
    34  			"Asin":            reflect.ValueOf(q.Asin),
    35  			"Asinh":           reflect.ValueOf(q.Asinh),
    36  			"Atan":            reflect.ValueOf(q.Atan),
    37  			"Atan2":           reflect.ValueOf(q.Atan2),
    38  			"Atanh":           reflect.ValueOf(q.Atanh),
    39  			"Cbrt":            reflect.ValueOf(q.Cbrt),
    40  			"Ceil":            reflect.ValueOf(q.Ceil),
    41  			"Copysign":        reflect.ValueOf(q.Copysign),
    42  			"Cos":             reflect.ValueOf(q.Cos),
    43  			"Cosh":            reflect.ValueOf(q.Cosh),
    44  			"Dim":             reflect.ValueOf(q.Dim),
    45  			"Erf":             reflect.ValueOf(q.Erf),
    46  			"Erfc":            reflect.ValueOf(q.Erfc),
    47  			"Erfcinv":         reflect.ValueOf(q.Erfcinv),
    48  			"Erfinv":          reflect.ValueOf(q.Erfinv),
    49  			"Exp":             reflect.ValueOf(q.Exp),
    50  			"Exp2":            reflect.ValueOf(q.Exp2),
    51  			"Expm1":           reflect.ValueOf(q.Expm1),
    52  			"FMA":             reflect.ValueOf(q.FMA),
    53  			"Float32bits":     reflect.ValueOf(q.Float32bits),
    54  			"Float32frombits": reflect.ValueOf(q.Float32frombits),
    55  			"Float64bits":     reflect.ValueOf(q.Float64bits),
    56  			"Float64frombits": reflect.ValueOf(q.Float64frombits),
    57  			"Floor":           reflect.ValueOf(q.Floor),
    58  			"Frexp":           reflect.ValueOf(q.Frexp),
    59  			"Gamma":           reflect.ValueOf(q.Gamma),
    60  			"Hypot":           reflect.ValueOf(q.Hypot),
    61  			"Ilogb":           reflect.ValueOf(q.Ilogb),
    62  			"Inf":             reflect.ValueOf(q.Inf),
    63  			"IsInf":           reflect.ValueOf(q.IsInf),
    64  			"IsNaN":           reflect.ValueOf(q.IsNaN),
    65  			"J0":              reflect.ValueOf(q.J0),
    66  			"J1":              reflect.ValueOf(q.J1),
    67  			"Jn":              reflect.ValueOf(q.Jn),
    68  			"Ldexp":           reflect.ValueOf(q.Ldexp),
    69  			"Lgamma":          reflect.ValueOf(q.Lgamma),
    70  			"Log":             reflect.ValueOf(q.Log),
    71  			"Log10":           reflect.ValueOf(q.Log10),
    72  			"Log1p":           reflect.ValueOf(q.Log1p),
    73  			"Log2":            reflect.ValueOf(q.Log2),
    74  			"Logb":            reflect.ValueOf(q.Logb),
    75  			"Max":             reflect.ValueOf(q.Max),
    76  			"Min":             reflect.ValueOf(q.Min),
    77  			"Mod":             reflect.ValueOf(q.Mod),
    78  			"Modf":            reflect.ValueOf(q.Modf),
    79  			"NaN":             reflect.ValueOf(q.NaN),
    80  			"Nextafter":       reflect.ValueOf(q.Nextafter),
    81  			"Nextafter32":     reflect.ValueOf(q.Nextafter32),
    82  			"Pow":             reflect.ValueOf(q.Pow),
    83  			"Pow10":           reflect.ValueOf(q.Pow10),
    84  			"Remainder":       reflect.ValueOf(q.Remainder),
    85  			"Round":           reflect.ValueOf(q.Round),
    86  			"RoundToEven":     reflect.ValueOf(q.RoundToEven),
    87  			"Signbit":         reflect.ValueOf(q.Signbit),
    88  			"Sin":             reflect.ValueOf(q.Sin),
    89  			"Sincos":          reflect.ValueOf(q.Sincos),
    90  			"Sinh":            reflect.ValueOf(q.Sinh),
    91  			"Sqrt":            reflect.ValueOf(q.Sqrt),
    92  			"Tan":             reflect.ValueOf(q.Tan),
    93  			"Tanh":            reflect.ValueOf(q.Tanh),
    94  			"Trunc":           reflect.ValueOf(q.Trunc),
    95  			"Y0":              reflect.ValueOf(q.Y0),
    96  			"Y1":              reflect.ValueOf(q.Y1),
    97  			"Yn":              reflect.ValueOf(q.Yn),
    98  		},
    99  		TypedConsts: map[string]gossa.TypedConst{},
   100  		UntypedConsts: map[string]gossa.UntypedConst{
   101  			"E":                      {"untyped float", constant.MakeFromLiteral("2.71828182845904523536028747135266249775724709369995957496696763", token.FLOAT, 0)},
   102  			"Ln10":                   {"untyped float", constant.MakeFromLiteral("2.3025850929940456840179914546843642076011014886287729760333279", token.FLOAT, 0)},
   103  			"Ln2":                    {"untyped float", constant.MakeFromLiteral("0.693147180559945309417232121458176568075500134360255254120680009", token.FLOAT, 0)},
   104  			"Log10E":                 {"untyped float", constant.BinaryOp(constant.MakeFromLiteral("10000000000000000000000000000000000000000000000000000000000000", token.INT, 0), token.QUO, constant.MakeFromLiteral("23025850929940456840179914546843642076011014886287729760333279", token.INT, 0))},
   105  			"Log2E":                  {"untyped float", constant.BinaryOp(constant.MakeFromLiteral("1000000000000000000000000000000000000000000000000000000000000000", token.INT, 0), token.QUO, constant.MakeFromLiteral("693147180559945309417232121458176568075500134360255254120680009", token.INT, 0))},
   106  			"MaxFloat32":             {"untyped float", constant.MakeFromLiteral("3.4028234663852885981170418348451692544e+38", token.FLOAT, 0)},
   107  			"MaxFloat64":             {"untyped float", constant.MakeFromLiteral("1.797693134862315708145274237317043567981e+308", token.FLOAT, 0)},
   108  			"MaxInt16":               {"untyped int", constant.MakeInt64(int64(q.MaxInt16))},
   109  			"MaxInt32":               {"untyped int", constant.MakeInt64(int64(q.MaxInt32))},
   110  			"MaxInt64":               {"untyped int", constant.MakeInt64(int64(q.MaxInt64))},
   111  			"MaxInt8":                {"untyped int", constant.MakeInt64(int64(q.MaxInt8))},
   112  			"MaxUint16":              {"untyped int", constant.MakeInt64(int64(q.MaxUint16))},
   113  			"MaxUint32":              {"untyped int", constant.MakeInt64(int64(q.MaxUint32))},
   114  			"MaxUint64":              {"untyped int", constant.MakeUint64(uint64(q.MaxUint64))},
   115  			"MaxUint8":               {"untyped int", constant.MakeInt64(int64(q.MaxUint8))},
   116  			"MinInt16":               {"untyped int", constant.MakeInt64(int64(q.MinInt16))},
   117  			"MinInt32":               {"untyped int", constant.MakeInt64(int64(q.MinInt32))},
   118  			"MinInt64":               {"untyped int", constant.MakeInt64(int64(q.MinInt64))},
   119  			"MinInt8":                {"untyped int", constant.MakeInt64(int64(q.MinInt8))},
   120  			"Phi":                    {"untyped float", constant.MakeFromLiteral("1.61803398874989484820458683436563811772030917980576286213544862", token.FLOAT, 0)},
   121  			"Pi":                     {"untyped float", constant.MakeFromLiteral("3.14159265358979323846264338327950288419716939937510582097494459", token.FLOAT, 0)},
   122  			"SmallestNonzeroFloat32": {"untyped float", constant.BinaryOp(constant.MakeFromLiteral("17516230804060213386546619791123951641", token.INT, 0), token.QUO, constant.MakeFromLiteral("12500000000000000000000000000000000000000000000000000000000000000000000000000000000", token.INT, 0))},
   123  			"SmallestNonzeroFloat64": {"untyped float", constant.MakeFromLiteral("4.940656458412465441765687928682213723651e-324", token.FLOAT, 0)},
   124  			"Sqrt2":                  {"untyped float", constant.MakeFromLiteral("1.41421356237309504880168872420969807856967187537694807317667974", token.FLOAT, 0)},
   125  			"SqrtE":                  {"untyped float", constant.MakeFromLiteral("1.64872127070012814684865078781416357165377610071014801157507931", token.FLOAT, 0)},
   126  			"SqrtPhi":                {"untyped float", constant.MakeFromLiteral("1.27201964951406896425242246173749149171560804184009624861664038", token.FLOAT, 0)},
   127  			"SqrtPi":                 {"untyped float", constant.MakeFromLiteral("1.77245385090551602729816748334114518279754945612238712821380779", token.FLOAT, 0)},
   128  		},
   129  	})
   130  }