aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/precision.h
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2024-04-23 15:58:54 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2024-04-23 15:58:54 -0400
commit9ba9c47a952ce6966b333af579bd39c636080fbc (patch)
tree0e08b6340a33fb76425440ff679b887812cfc569 /src/precision.h
parent404c7eb61c586b4ff0d64506488fffdd66f06f94 (diff)
added preprocessor to change precision at compile time
Diffstat (limited to 'src/precision.h')
-rw-r--r--src/precision.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/precision.h b/src/precision.h
new file mode 100644
index 0000000..e83122a
--- /dev/null
+++ b/src/precision.h
@@ -0,0 +1,29 @@
+/*
+ * Header that allows conditional compilation into double floating point precisions ot extended double floating point precision
+ *
+ * CUDA does not support long double so cuda-fractals may fail to compile or have unexpected behavior if linked with code that was compiled with EXTENDED_PRECISION
+ */
+#pragma once
+
+#ifdef EXTENDED_PRECISION
+
+#define CBASE long double
+#define CREAL creall
+#define CIMAG cimagl
+#define CPOW cpowl
+#define CONJ conjl
+#define CABS cabsl
+#define CFORMAT "%Lf"
+
+#endif
+#ifndef EXTENDED_PRECISION
+
+#define CBASE double
+#define CREAL creal
+#define CIMAG cimag
+#define CPOW cpow
+#define CONJ conj
+#define CABS cabs
+#define CFORMAT "%lf"
+
+#endif