Class Power
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the POWER mathematical function that raises a base number to a specified exponent.
public class Power : Function, ICheckItem, IDefaultItem, IFilterItem, IElement
- Inheritance
-
Power
- Implements
Remarks
The POWER function calculates base^exponent. For example, POWER(2, 3) returns 8, POWER(10, -2) returns 0.01. This is useful for exponential growth calculations, scientific computations, and mathematical modeling. Note that certain combinations (like negative base with fractional exponent) may produce errors.
Examples
Compute the squared value of each measurement:
var schema = manager.LoadSchema("measurements");
var readings = schema["readings"];
var query = new Query()
.Select([ readings["id"], new Expression("squared", new Power(readings["value"], 2.0)) ])
.From(readings);
var results = manager.Retrieve(query);
Constructors
- Power(double, double)
Initializes a new instance of POWER with literal base and exponent values.
- Power(Column, double)
Initializes a new instance of POWER with a column base and literal exponent.
- Power(Column, Column)
Initializes a new instance of POWER with column-based base and exponent.
- Power(Column, Expression)
Initializes a new instance of POWER with a column base and expression exponent.
- Power(Expression, Expression)
Initializes a new instance of POWER with expression-based base and exponent.