Please note I have corrected the typo in the thread title. 10:20 AM EST 6-11-2010
Simple question: Does anyone know if the standard specifies what happens when integers overflow? Through some experimentation with intel 11.1.046 it looks like the value of the integer seems to wrap around. i.e
PROGRAM int_explode IMPLICIT NONE INTEGER :: my_int my_int = HUGE(my_int) PRINT*, my_int my_int = my_int + 1 PRINT*, my_int PRINT*, -HUGE(my_int) - 1 IF ( my_int == -HUGE(my_int - 1) PRINT*, 'Integer overflow wraps around.' END PROGRAM
Is thisbehaviorspecified by the standard, or will relying on it result in non-portable code? Many thanks, -Z



