aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/imul32.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/osb/imul32.c')
-rw-r--r--sys/osb/imul32.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/osb/imul32.c b/sys/osb/imul32.c
new file mode 100644
index 00000000..237bd5fa
--- /dev/null
+++ b/sys/osb/imul32.c
@@ -0,0 +1,24 @@
+#define import_spp
+#define import_knames
+#include <iraf.h>
+
+
+/* IMUL32 - Multiply two integer values and return the result. This is
+ * needed to allow e.g. the normal overflow condition to occur for algorithms
+ * such as random number generators.
+ */
+int
+IMUL32 (long *a, long *b)
+{
+ int val = 0;
+ int ia = (int) *a;
+ int ib = (int) *b;
+
+
+ /* MACHDEP - Depends on integer overflow behavior for a specific
+ * platform.
+ */
+ val = ia * ib;
+
+ return ((int) val);
+}