diff --git a/runners/calculator/qalculate_engine.cpp b/runners/calculator/qalculate_engine.cpp --- a/runners/calculator/qalculate_engine.cpp +++ b/runners/calculator/qalculate_engine.cpp @@ -98,6 +98,10 @@ eo.parse_options.angle_unit = ANGLE_UNIT_RADIANS; eo.structuring = STRUCTURING_SIMPLIFY; + // suggested in https://github.com/Qalculate/libqalculate/issues/16 + // to avoid memory overflow for seemingly innocent calculations (Bug 277011) + eo.approximation = APPROXIMATION_APPROXIMATE; + CALCULATOR->setPrecision(16); MathStructure result = CALCULATOR->calculate(ctext, eo);