Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
4 Views

remark #7960: The floating overflow condition was detected while evaluating this operation; the result is an infinity.

Jump to solution

I need to define a very large constant for the cases that I need infinity; but I noticed this warning:

remark #7960: The floating overflow condition was detected while evaluating this operation; the result is an infinity.

Now I wonder if there is a standard way to define +infinity or -infinity?
 

0 Kudos

Accepted Solutions
Highlighted
Black Belt
4 Views

use, intrinsic :: IEEE

Jump to solution

use, intrinsic :: IEEE_ARITHMETIC
...
x = IEEE_VALUE(x,IEEE_POSITIVE_INF)

You will want to compile with /fp:strict in order to support exceptional values.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran

View solution in original post

0 Kudos
1 Reply
Highlighted
Black Belt
5 Views

use, intrinsic :: IEEE

Jump to solution

use, intrinsic :: IEEE_ARITHMETIC
...
x = IEEE_VALUE(x,IEEE_POSITIVE_INF)

You will want to compile with /fp:strict in order to support exceptional values.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran

View solution in original post

0 Kudos