Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFloatFromInt ¶
Types ¶
type Expression ¶
type Expression interface { Evaluate(variables map[string]*big.Float) (*big.Float, error) String() string // Variables returns a map of all variables used in the expression. // For example, the expression "4a + 2b" would return a map with keys "a" and "b". Variables() map[string]struct{} }
func Add ¶
func Add(a, b Expression) Expression
func Div ¶
func Div(a, b Expression) Expression
func Log ¶
func Log(a Expression, base ...Expression) Expression
Log returns the logarithm of a with base "base". If base is not provided, it defaults to 2.
func Mul ¶
func Mul(a, b Expression) Expression
func Sub ¶
func Sub(a, b Expression) Expression
func WeightedVar ¶
func WeightedVar(name string, weight *big.Float) Expression
Click to show internal directories.
Click to hide internal directories.