gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1488 Posts in 491 Topics by 716 Members - Latest Member: paul.macmillan May 26, 2019, 07:11:32 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  nint throws a SIGFPE in Fx3
gfx
gfxgfx
 

Author Topic: nint throws a SIGFPE in Fx3  (Read 2769 times)

eabergman

  • Newbie
  • *
  • Posts: 2
nint throws a SIGFPE in Fx3
« on: April 14, 2018, 11:59:13 PM »
I've been using Absoft Fortran to build research codes on Mac for many years. I just tried to use the Fx3 debugger this evening (for the first time) to hunt down a floating point exception that occurs on occasion, but I'm not getting anywhere close to that bug because Fx3 stops with a SIGFPE almost immediately when it runs into an instance of the intrinsic procedure "nint", which I use to to convert a real value to an integer for comparison with an integer in a structured if pattern. I wrote a very short test program that recreates the problem, which goes away if I use the "int" function instead.

program comp
   real :: value(4)
   integer :: i
   data value/1.,1.,0.,1./
   do i = 1,4
      if (nint(value(i)) .eq. 0) print *, i, value(i), ' = zero'
   end do
   stop
end program comp

This has never been an issue when I ran my code normally, only when I run it under Fx3. But it's preventing me from using Fx3 to get to the real problem I'm chasing. 

Thanks for any help,

Eric

eabergman

  • Newbie
  • *
  • Posts: 2
Re: nint throws a SIGFPE in Fx3
« Reply #1 on: April 15, 2018, 11:49:12 AM »
After posting my question I kept poking at this issue and and discovered the cause. In the project settings for FORTRAN I had set all the checkboxes for exceptions. The use of the "nint" intrinsic function triggered the one for "precision". After unchecking it, all was good and I went on to find the bug I was chasing originally (a brazen divide by zero).

Absoft User Forum  |  Support  |  General  |  nint throws a SIGFPE in Fx3
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!