diff --git a/ClosedXML/Excel/CalcEngine/Functions/MathTrig.cs b/ClosedXML/Excel/CalcEngine/Functions/MathTrig.cs index c6ef569..2a4d6fe 100644 --- a/ClosedXML/Excel/CalcEngine/Functions/MathTrig.cs +++ b/ClosedXML/Excel/CalcEngine/Functions/MathTrig.cs @@ -132,11 +132,14 @@ foreach (byte digit in asciiValues) { + if (digit > 90) + { + throw new NumberException(); + } + int digitNumber = digit >= 48 && digit < 58 ? digit - 48 - : digit > 90 - ? throw new NumberException() - : digit - 55; + : digit - 55; if (digitNumber > radix - 1) throw new NumberException();