/// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="convOne">convertor for LHS</param>
 /// <param name="convTwo">convertor for RHS</param>
 public DivideBigIntConvComputer(
     BigIntegerCoercer convOne,
     BigIntegerCoercer convTwo)
 {
     _convOne = convOne;
     _convTwo = convTwo;
 }
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="convOne">conversion for LHS</param>
 /// <param name="convTwo">conversion for RHS</param>
 public AddBigIntConvComputer(
     BigIntegerCoercer convOne,
     BigIntegerCoercer convTwo)
 {
     this._convOne = convOne;
     this._convTwo = convTwo;
 }
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="convOne">conversion for LHS</param>
 /// <param name="convTwo">conversion for RHS</param>
 public MultiplyBigIntConvComputer(
     BigIntegerCoercer convOne,
     BigIntegerCoercer convTwo)
 {
     this.convOne = convOne;
     this.convTwo = convTwo;
 }
示例#4
0
        public ExprMinMaxRowNodeForgeEval(
            ExprMinMaxRowNodeForge forge,
            ExprEvaluator[] evaluators,
            ExprForge[] forges)
        {
            this.forge = forge;
            if (forge.EvaluationType.IsBigInteger()) {
                var convertors = new BigIntegerCoercer[evaluators.Length];
                for (var i = 0; i < evaluators.Length; i++) {
                    convertors[i] = SimpleNumberCoercerFactory.GetCoercerBigInteger(forges[i].EvaluationType);
                }

                computer = new MinMaxType.ComputerBigIntCoerce(
                    evaluators,
                    convertors,
                    forge.ForgeRenderable.MinMaxTypeEnum == MinMaxTypeEnum.MAX);
            }
            else if (forge.EvaluationType.IsDecimal()) {
                if (forge.ForgeRenderable.MinMaxTypeEnum == MinMaxTypeEnum.MAX) {
                    computer = new MinMaxType.MaxComputerDecimalCoerce(evaluators);
                }
                else {
                    computer = new MinMaxType.MinComputerDecimalCoerce(evaluators);
                }
            }
            else {
                if (forge.ForgeRenderable.MinMaxTypeEnum == MinMaxTypeEnum.MAX) {
                    computer = new MinMaxType.MaxComputerDoubleCoerce(evaluators);
                }
                else {
                    computer = new MinMaxType.MinComputerDoubleCoerce(evaluators);
                }
            }
        }
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="convOne">convertor for LHS</param>
 /// <param name="convTwo">convertor for RHS</param>
 public SubtractBigIntConvComputer(
     BigIntegerCoercer convOne,
     BigIntegerCoercer convTwo)
 {
     this.convOne = convOne;
     this.convTwo = convTwo;
 }
示例#6
0
            public ExprBetweenCompBigInteger(
                bool lowIncluded,
                bool highIncluded,
                Type valueType,
                Type lowerType,
                Type upperType)
            {
                _isLowIncluded = lowIncluded;
                _isHighIncluded = highIncluded;

                _numberCoercerLower = SimpleNumberCoercerFactory.GetCoercerBigInteger(lowerType);
                _numberCoercerUpper = SimpleNumberCoercerFactory.GetCoercerBigInteger(upperType);
                _numberCoercerValue = SimpleNumberCoercerFactory.GetCoercerBigInteger(valueType);
            }
        public static CodegenExpression CodegenBigIntConv(
            CodegenExpression lhs,
            Type lhsType,
            CodegenExpression rhs,
            Type rhsType,
            BigIntegerCoercer convLeft,
            BigIntegerCoercer convRight,
            CodegenExpressionRelational.CodegenRelational rel)
        {
            var leftConv  = convLeft.CoerceBoxedBigIntCodegen(lhs, lhsType);
            var rightConv = convRight.CoerceBoxedBigIntCodegen(rhs, rhsType);

            return(CodegenExpressionBuilder.Relational(
                       CodegenExpressionBuilder.ExprDotMethod(leftConv, "CompareTo", rightConv),
                       rel,
                       CodegenExpressionBuilder.Constant(0)));
        }
示例#8
0
        public static CodegenExpression Codegen(
            ExprMinMaxRowNodeForge forge,
            CodegenMethodScope codegenMethodScope,
            ExprForgeCodegenSymbol exprSymbol,
            CodegenClassScope codegenClassScope)
        {
            var resultType = forge.EvaluationType;
            var nodes = forge.ForgeRenderable.ChildNodes;

            CodegenExpression expression;
            if (resultType.IsBigInteger()) {
                var convertors = new BigIntegerCoercer[nodes.Length];
                for (var i = 0; i < nodes.Length; i++) {
                    convertors[i] = SimpleNumberCoercerFactory.GetCoercerBigInteger(nodes[i].Forge.EvaluationType);
                }

                expression = MinMaxType.ComputerBigIntCoerce.Codegen(
                    forge.ForgeRenderable.MinMaxTypeEnum == MinMaxTypeEnum.MAX,
                    codegenMethodScope,
                    exprSymbol,
                    codegenClassScope,
                    nodes,
                    convertors);
            }
            else if (resultType.IsDecimal()) {
                if (forge.ForgeRenderable.MinMaxTypeEnum == MinMaxTypeEnum.MAX) {
                    expression = MinMaxType.MaxComputerDecimalCoerce.Codegen(
                        codegenMethodScope,
                        exprSymbol,
                        codegenClassScope,
                        nodes,
                        resultType);
                }
                else {
                    expression = MinMaxType.MinComputerDecimalCoerce.Codegen(
                        codegenMethodScope,
                        exprSymbol,
                        codegenClassScope,
                        nodes,
                        resultType);
                }
            }
            else {
                if (forge.ForgeRenderable.MinMaxTypeEnum == MinMaxTypeEnum.MAX) {
                    expression = MinMaxType.MaxComputerDoubleCoerce.Codegen(
                        codegenMethodScope,
                        exprSymbol,
                        codegenClassScope,
                        nodes,
                        resultType);
                }
                else {
                    expression = MinMaxType.MinComputerDoubleCoerce.Codegen(
                        codegenMethodScope,
                        exprSymbol,
                        codegenClassScope,
                        nodes,
                        resultType);
                }
            }

            return expression;
        }