binary

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (

	// PlusType adds datapoints in both series
	PlusType = "+"

	// MinusType subtracts rhs from lhs
	MinusType = "-"

	// MultiplyType multiplies datapoints by series
	MultiplyType = "*"

	// DivType divides datapoints by series
	// Special cases are:
	// 	 X / 0 = +Inf
	// 	-X / 0 = -Inf
	// 	 0 / 0 =  NaN
	DivType = "/"

	// ExpType raises lhs to the power of rhs
	// NB: to keep consistency with prometheus (and go)
	//  0 ^ 0 = 1
	//  NaN ^ 0 = 1
	ExpType = "^"

	// ModType takes the modulo of lhs by rhs
	// Special cases are:
	// 	 X % 0 = NaN
	// 	 NaN % X = NaN
	// 	 X % NaN = NaN
	ModType = "%"

	// EqType raises lhs to the power of rhs
	EqType = "=="

	// NotEqType raises lhs to the power of rhs
	NotEqType = "!="

	// GreaterType raises lhs to the power of rhs
	GreaterType = ">"

	// LesserType raises lhs to the power of rhs
	LesserType = "<"

	// GreaterEqType raises lhs to the power of rhs
	GreaterEqType = ">="

	// LesserEqType raises lhs to the power of rhs
	LesserEqType = "<="
)

Variables

This section is empty.

Functions

func NewBinaryOp

func NewBinaryOp(
	opType string,
	params NodeParams,
) (parser.Params, error)

NewBinaryOp creates a new binary operation

Types

type NodeParams

type NodeParams struct {
	LNode, RNode         parser.NodeID
	LIsScalar, RIsScalar bool
	ReturnBool           bool
	VectorMatching       *logical.VectorMatching
}

NodeParams describes the types of nodes used for binary operations

Jump to

Keyboard shortcuts

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