diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/osb/imul32.c | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/osb/imul32.c')
-rw-r--r-- | sys/osb/imul32.c | 24 |
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); +} |