using uCalcSoftware; var uc = new uCalc(); // Enable only the division by zero error uc.Error.TrapOnDivideByZero = true; // This should now raise a uCalc error Console.WriteLine($"Test 1 (Div by Zero): {uc.EvalStr("1/0")}"); // This should still return 'inf' by default, as we didn't enable overflow errors Console.WriteLine($"Test 2 (Overflow): {uc.EvalStr("1e308 * 2")}"); // For comparison, enable overflow errors as well uc.Error.TrapOnOverflow = true; Console.WriteLine($"Test 3 (Overflow with error): {uc.EvalStr("1e308 * 2")}");