Software Archive
Read-only legacy content
17060 Discussions

Integer Overflow

Intel_C_Intel
Employee
868 Views
We are developing a Visual C++ and (mostly) Compaq Fortran program for Windows 98/NT/2000. Is there a way checking to see if an integer*8 overflow has occurred in the Fortran code? We need to set an error flag if one has occured, but otherwise continue processing. We also have to reset any checks to be able to see when the next integer overlow occurs.

We trap floating point operations, which works well, but have not found a way of checking for (or trapping) integer overflows.

Eddie
0 Kudos
2 Replies
Intel_C_Intel
Employee
868 Views
I assume this is not possible?

The work-around we use (which is not very efficient) is to do the caluculations in floating point, check that the results do not exceed the maximum Integer*8 value, then recaclulate in integer value.

Any other ideas?
Eddie
0 Kudos
Steven_L_Intel1
Employee
868 Views
Hmm - doesn't seem to be. I suggest writing to vf-support@compaq.com and ask - this is not a subject I'm familiar with.

Steve
0 Kudos
Reply