summaryrefslogtreecommitdiff
path: root/sc/source/core/opencl/formulagroupcl_public.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/opencl/formulagroupcl_public.hxx')
-rw-r--r--sc/source/core/opencl/formulagroupcl_public.hxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/source/core/opencl/formulagroupcl_public.hxx b/sc/source/core/opencl/formulagroupcl_public.hxx
index 3b36770e6014..0ce60ce80e6b 100644
--- a/sc/source/core/opencl/formulagroupcl_public.hxx
+++ b/sc/source/core/opencl/formulagroupcl_public.hxx
@@ -11,6 +11,27 @@
#define INCLUDED_SC_SOURCE_CORE_OPENCL_FORMULAGROUPCL_PUBLIC_HXX
const char* publicFunc =
+ "\n"
+ "#define errIllegalFPOperation 503 // #NUM!\n"
+ "#define errNoValue 519 // #VALUE!\n"
+ "#define errDivisionByZero 532 // #DIV/0!\n"
+ "\n"
+ "double CreateDoubleError(ulong nErr)\n"
+ "{\n"
+ " return nan(nErr);\n"
+ "}\n"
+ "\n"
+ "uint GetDoubleErrorValue(double fVal)\n"
+ "{\n"
+ " if (isfinite(fVal))\n"
+ " return 0;\n"
+ " if (isinf(fVal))\n"
+ " return errIllegalFPOperation; // normal INF\n"
+ " if (as_ulong(fVal) & 0XFFFF0000u)\n"
+ " return errNoValue; // just a normal NAN\n"
+ " return (as_ulong(fVal) & 0XFFFF); // any other error\n"
+ "}\n"
+ "\n"
"int isNan(double a) { return isnan(a); }\n"
"double fsum_count(double a, double b, __private int *p) {\n"
" bool t = isNan(a);\n"