Documentation
¶
Index ¶
- Constants
- Variables
- func Abs(a complex128) complex128
- func Add(a, b complex128) complex128
- func Arity(stk *Stack, arity int)
- func Complex(a, b complex128) complex128
- func Imag(a complex128) complex128
- func Mul(a, b complex128) complex128
- func Neg(a complex128) complex128
- func Phase(a complex128) complex128
- func Quo(a, b complex128) complex128
- func Real(a complex128) complex128
- func Rect(a, b complex128) complex128
- func Sub(a, b complex128) complex128
- type Calculator
- type Stack
- func (stk *Stack) Clear()
- func (stk *Stack) Pop() (v complex128, ok bool)
- func (stk *Stack) PopArgs(arity int) (args []reflect.Value, ok bool)
- func (stk *Stack) Push(v complex128)
- func (stk *Stack) PushImag(v string)
- func (stk *Stack) PushReal(v float64)
- func (stk *Stack) PushRet(ret []reflect.Value) error
Constants ¶
View Source
const Grammar = `` /* 218-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": Abs, "acos": cmplx.Acos, "acosh": cmplx.Acosh, "asin": cmplx.Asin, "asinh": cmplx.Asinh, "atan": cmplx.Atan, "atanh": cmplx.Atanh, "conj": cmplx.Conj, "cos": cmplx.Cos, "cosh": cmplx.Cosh, "cot": cmplx.Cot, "exp": cmplx.Exp, "inf": cmplx.Inf, "log": cmplx.Log, "log10": cmplx.Log10, "NaN": cmplx.NaN, "phase": Phase, "pow": cmplx.Pow, "rect": Rect, "sin": cmplx.Sin, "sinh": cmplx.Sinh, "sqrt": cmplx.Sqrt, "tan": cmplx.Tan, "tanh": cmplx.Tanh, "real": Real, "imag": Imag, "complex": Complex, "$neg": Neg, "$mul": Mul, "$quo": Quo, "$add": Add, "$sub": Sub, "$ARITY": Arity, "$push": (*Stack).PushReal, "$pushi": (*Stack).PushImag, "$call": (*Calculator).Call, }
Functions ¶
func Abs ¶
func Abs(a complex128) complex128
func Add ¶
func Add(a, b complex128) complex128
func Complex ¶
func Complex(a, b complex128) complex128
func Imag ¶
func Imag(a complex128) complex128
func Mul ¶
func Mul(a, b complex128) complex128
func Neg ¶
func Neg(a complex128) complex128
func Phase ¶
func Phase(a complex128) complex128
func Quo ¶
func Quo(a, b complex128) complex128
func Real ¶
func Real(a complex128) complex128
func Rect ¶
func Rect(a, b complex128) complex128
func Sub ¶
func Sub(a, b complex128) complex128
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 complex128, ok bool)
func (*Calculator) Stack ¶
func (p *Calculator) Stack() interpreter.Stack
type Stack ¶
type Stack []complex128
func (*Stack) Pop ¶
func (stk *Stack) Pop() (v complex128, ok bool)
func (*Stack) Push ¶
func (stk *Stack) Push(v complex128)
Click to show internal directories.
Click to hide internal directories.