Documentation ¶
Index ¶
- Constants
- Variables
- func Add(a, b float64) float64
- func Arity(stk *Stack, arity int)
- func Inf(a float64) float64
- func Jn(a, b float64) float64
- func Ldexp(a, b float64) float64
- func Max(args ...float64) (max float64)
- func Min(args ...float64) (min float64)
- func Mul(a, b float64) float64
- func Neg(a float64) float64
- func Pow10(a float64) float64
- func Quo(a, b float64) float64
- func Sub(a, b float64) float64
- func Yn(a, b float64) float64
- type Calculator
- type Stack
Constants ¶
View Source
const Grammar = `` /* 236-byte string literal not displayed */
-----------------------------------------------------------------------------
Variables ¶
View Source
var ( ErrUnsupportedRetType = errors.New("unsupported return type of function") ErrFncallWithoutArity = errors.New("function call without arity") )
View Source
var Fntable = map[string]interface{}{ "abs": math.Abs, "acos": math.Acos, "acosh": math.Acosh, "asin": math.Asin, "asinh": math.Asinh, "atan": math.Atan, "atan2": math.Atan2, "atanh": math.Atanh, "cbrt": math.Cbrt, "ceil": math.Ceil, "copysign": math.Copysign, "cos": math.Cos, "cosh": math.Cosh, "dim": math.Dim, "erf": math.Erf, "erfc": math.Erfc, "exp": math.Exp, "exp2": math.Exp2, "expm1": math.Expm1, "floor": math.Floor, "gamma": math.Gamma, "hypot": math.Hypot, "inf": Inf, "j0": math.J0, "j1": math.J1, "jn": Jn, "ldexp": Ldexp, "ln": math.Log, "log": math.Log, "log10": math.Log10, "log1p": math.Log1p, "log2": math.Log2, "logb": math.Logb, "max": Max, "min": Min, "mod": math.Mod, "NaN": math.NaN, "nextafter": math.Nextafter, "pow": math.Pow, "pow10": Pow10, "remainder": math.Remainder, "sin": math.Sin, "sinh": math.Sinh, "sqrt": math.Sqrt, "tan": math.Tan, "tanh": math.Tanh, "trunc": math.Trunc, "y0": math.Y0, "y1": math.Y1, "yn": Yn, "$neg": Neg, "$mul": Mul, "$quo": Quo, "$mod": math.Mod, "$add": Add, "$sub": Sub, "$ARITY": Arity, "$push": (*Stack).Push, "$ident": (*Stack).PushIdent, "$call": (*Calculator).Call, }
Functions ¶
Types ¶
type Calculator ¶
type Calculator struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Calculator
func (*Calculator) Call ¶
func (p *Calculator) Call(name string) error
func (*Calculator) Fntable ¶
func (p *Calculator) Fntable() map[string]interface{}
func (*Calculator) Grammar ¶
func (p *Calculator) Grammar() string
func (*Calculator) Ret ¶
func (p *Calculator) Ret() (v float64, ok bool)
func (*Calculator) Stack ¶
func (p *Calculator) Stack() interpreter.Stack
Click to show internal directories.
Click to hide internal directories.