@@ -10,14 +10,12 @@ Date Author Change
1010 *************************************************************************************************
1111 01/27/2020 EPPlus Software AB Initial release EPPlus 5
1212 *************************************************************************************************/
13- using System ;
1413using OfficeOpenXml . FormulaParsing . FormulaExpressions ;
15- using OfficeOpenXml . FormulaParsing . Exceptions ;
1614using OfficeOpenXml . FormulaParsing . LexicalAnalysis ;
17- using System . Diagnostics ;
1815using OfficeOpenXml . FormulaParsing . Ranges ;
19- using OfficeOpenXml . FormulaParsing . Excel . Functions . MathFunctions ;
2016using OfficeOpenXml . Utils . TypeConversion ;
17+ using System ;
18+ using System . Diagnostics ;
2119
2220namespace OfficeOpenXml . FormulaParsing . Excel . Operators
2321{
@@ -288,6 +286,18 @@ public static IOperator Exp
288286 var res = Math . Pow ( l . ResultNumeric , r . ResultNumeric ) ;
289287 return CreateCompileResult ( l . ResultType , r . ResultType , res , DataType . Decimal ) ;
290288 }
289+ if ( l . DataType == DataType . String || r . DataType == DataType . String )
290+ {
291+ return CompileResult . GetErrorResult ( eErrorType . Value ) ;
292+ }
293+ if ( l . Result is ExcelErrorValue )
294+ {
295+ return new CompileResult ( l . Result , DataType . ExcelError ) ;
296+ }
297+ else if ( r . Result is ExcelErrorValue )
298+ {
299+ return new CompileResult ( r . Result , DataType . ExcelError ) ;
300+ }
291301 return CompileResult . ZeroDecimal ;
292302 } ) ;
293303 }
0 commit comments