Class Avg
Prefix operation that return the average of a set of numbers
Operand Count: 0 to infinite
Operand Type: number, if the operand count is 1, it can be an array
Output Type: double
Usage: avg(1, 2, 3, 4, 5) or avg(@(1, 2, 3, 4, 5))
Note: null value will not be counted, therefore avg(null, 2, 2, 2) should be 6/3 = 2 not 6/4 = 1.5; It will return null if the count is 0.
Implements
Inherited Members
Namespace: Albatross.Expression.Operations
Assembly: Albatross.Expression.dll
Syntax
public class Avg : PrefixOperationToken, IToken
Properties
MaxOperandCount
Declaration
public override int MaxOperandCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
MinOperandCount
Declaration
public override int MinOperandCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Name
Declaration
public override string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Symbolic
Declaration
public override bool Symbolic { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Methods
EvalValue(Func<String, Object>)
Declaration
public override object EvalValue(Func<string, object> context)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.String, System.Object> | context |
Returns
Type | Description |
---|---|
System.Object |