My Oracle Support Banner

How can C/Fortran floating point exceptions be trapped on Solaris in order to modify the default results. (Doc ID 1295477.1)

Last updated on JANUARY 05, 2024

Applies to:

Oracle Solaris Studio - Version Forte Developer 6 Update 2 to 12.2 [Release 6.0 to 12]
Oracle Solaris on SPARC (32-bit)
Oracle Solaris on SPARC (64-bit)
Oracle Solaris on x86-64 (64-bit)
Oracle Solaris on x86 (32-bit)

Goal

 

How can Fortran floating point exceptions be trapped on Solaris platforms so that:

0.0 / 0.0 = 0.0
Inf / Inf = Inf
Inf * 0.0 = 0.0

Without trapping all three result in -NaN (Not A Number). Note:  "Inf" is infinity.

In Fortran, the default execution of the following sample (test_exceptions.f) will result in :

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
 How to apply those C routines in Fortran code ?


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.