Class EnsureDenominatorIsTypeDouble
For any BinaryOperation with Divide, apply Mangrove.MetricSetTransformers.Internal.Arithmetic.EnsureTypeDouble(Mangrove.MetricSetSyntaxTree.Expression) to the denominator. Mangrove makes the assumption that number division is non-integer, so for any a/b with a and b both integer, we need to explicitly cast b to type double.
For example, if a literal is of type double but the value is specified as "1", in the generated script it would simply be "1", and so for example if the script has a division 1/SUM(integer value), this division will be incorrectly treated as INTEGER division and NOT DOUBLE division, which would result in the value 0.
Inheritance
EnsureDenominatorIsTypeDouble
Implements
Inherited Members
Namespace: Mangrove.MetricSetTransformers.Normalization
Assembly: MetricSetTransformers.dll
Syntax
public class EnsureDenominatorIsTypeDouble : ChangeExpressions, IGenericExpressionVisitor<IEnumerable<Expression>>, IExpressionVisitor, IGenericVisitor<IEnumerable<Expression>>
Methods
View SourceChange(BinaryOperation)
Declaration
protected override Expression Change(BinaryOperation bo)
Parameters
Type | Name | Description |
---|---|---|
BinaryOperation | bo |
Returns
Type | Description |
---|---|
Expression |