summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/tool/math.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/core/tool/math.cxx b/sc/source/core/tool/math.cxx
index a077d5c3521a..3c496f83833c 100644
--- a/sc/source/core/tool/math.cxx
+++ b/sc/source/core/tool/math.cxx
@@ -53,8 +53,13 @@ double power(const double& fVal1, const double& fVal2)
}
// The pow() call must had been the most recent call to check errno or exception.
if ((((math_errhandling & MATH_ERRNO) != 0) && (errno == EDOM || errno == ERANGE))
+// emscripten is currently broken by https://github.com/emscripten-core/emscripten/pull/11087
+// While the removal is correct for C99, it's not for C++11 (see http://www.cplusplus.com/reference/cfenv/FE_INEXACT/)
+// But since emscripten currently doesn't support any math exceptions, we simply ignore them
+#ifndef __EMSCRIPTEN__
|| (((math_errhandling & MATH_ERREXCEPT) != 0)
&& std::fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW))
+#endif
|| !std::isfinite(fPow))
{
fPow = CreateDoubleError(FormulaError::IllegalFPOperation);