Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28991 Discussions

Anything available for UNSIGNED arithmetic ?

WSinc
New Contributor I
237 Views
Suppose I am working with all positive numbers, and I want to take full advantage of the
32-bit words. Ex: I can only get up to 2**31-1 with signed numbers, but I would like to go
up to 2**32-1, taking advantage of all 32 bits.

Also, when I multiply two 32 bit numbers, I might get up to 64 bit results, so I should be able to manipulate
64-bit unsigned numbers as well.

Now with C++ you CAN declare unsigned variables, so is there a way (i.e utility subroutines) to do that in the current Fortran?
The problem is: C++ does not have 64-bit variables thaqt I know of.

Or maybe I have to write machine code for the Pentium, if no one else has done that. It probably does have unsigned arithmetic at the machine code level.

Any clues on this?

Thanks; Bill.
0 Kudos
1 Reply
TimP
Honored Contributor III
237 Views
All C and C++ compilers likely to be linked with ifort have 64-bit integer data types. If your favorite C++ compiler doesn't support long long, there should be something like __int64.
0 Kudos
Reply