- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reponse of my previous question.
Here is another question: Is the "unsigned" type in C equal to "integer*8" in CVF?
erheiqin
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, an 8-byte Fortran integer is still signed, like C signed long long int. Depending on your needs, you might use it to simulate an unsigned 32-bit integer, if you didn't mind the inefficiency.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran doesn't have an unsigned integer type. Depending on your needs, as Tim suggests, the integer*8 type can hold the full range of a 32-bit unsigned. Some might suggest relying on integer overflow checking being off to do "unsigned arithmetic, but that's risky as the compiler makes assumptions that may not hold if you do this.
Steve
Steve
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