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

unsigned

erheiqin
Beginner
1,212 Views

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
0 Kudos
2 Replies
TimP
Honored Contributor III
1,212 Views
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.
0 Kudos
Steven_L_Intel1
Employee
1,212 Views
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
0 Kudos
Reply