diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/osb/imul32.c | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
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); +} |