numexpr

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Const

type Const[T bt.Rational] struct {
	V T
	// contains filtered or unexported fields
}

func NewConst

func NewConst[T bt.Rational](v T) Const[T]

func (Const[T]) Eval

func (n Const[T]) Eval() T

func (Const[T]) Render

func (n Const[T]) Render(sb *strings.Builder)

type Node

type Node[T bt.Rational] interface {
	Eval() T
	Render(sb *strings.Builder)
	// contains filtered or unexported methods
}

type Op

type Op[T bt.Rational] struct {
	K  OpKind
	Vs []Node[T]
	// contains filtered or unexported fields
}

func Add

func Add[T bt.Rational](vs ...Node[T]) Op[T]

func Div

func Div[T bt.Rational](vs ...Node[T]) Op[T]

func Mod

func Mod[T bt.Rational](vs ...Node[T]) Op[T]

func Mul

func Mul[T bt.Rational](vs ...Node[T]) Op[T]

func Sub

func Sub[T bt.Rational](vs ...Node[T]) Op[T]

func (Op[T]) Eval

func (n Op[T]) Eval() T

func (Op[T]) Render

func (n Op[T]) Render(sb *strings.Builder)

type OpKind

type OpKind int8
const (
	InvalidOp OpKind = iota
	AddOp
	SubOp
	MulOp
	DivOp
	ModOp
)

func (OpKind) String

func (k OpKind) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL