- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page