Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

catching divide by zero

$
0
0

I have not been able to catch divide by zero errors in my code. I've tried many variations of settings in the project file, in debug mode. The result of a divide by zero is infinity, but I want execution to stop and report an error. I reproduced the situation with this code:

program test_divide_by_0
i = 0
z = 1.0/i
print*, z
end

This runs without reporting any error and writes out Infinity. I'm using Composer XE 2013.


Viewing all articles
Browse latest Browse all 5691

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>