Rev | Line | |
---|
[12074] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using OfficeOpenXml.FormulaParsing.ExpressionGraph;
|
---|
| 6 |
|
---|
| 7 | namespace OfficeOpenXml.FormulaParsing.Excel.Functions.Math
|
---|
| 8 | {
|
---|
| 9 | public class Quotient : ExcelFunction
|
---|
| 10 | {
|
---|
| 11 | public override CompileResult Execute(IEnumerable<FunctionArgument> arguments, ParsingContext context)
|
---|
| 12 | {
|
---|
| 13 | ValidateArguments(arguments, 2);
|
---|
| 14 | var num = ArgToDecimal(arguments, 0);
|
---|
| 15 | var denom = ArgToDecimal(arguments, 1);
|
---|
| 16 | ThrowExcelErrorValueExceptionIf(() => (int)denom == 0, eErrorType.Div0);
|
---|
| 17 | var result = (int)(num/denom);
|
---|
| 18 | return CreateResult(result, DataType.Integer);
|
---|
| 19 | }
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.