forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unexpected FP div-by-zero with /64
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
mecej4



Joined: 31 Oct 2006
Posts: 1884

PostPosted: Mon Mar 08, 2021 1:15 pm    Post subject: Reply with quote

OK, thanks! It must be the math library used by Gfortran/GCC, then.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2551
Location: Sydney

PostPosted: Tue Mar 09, 2021 12:22 am    Post subject: Reply with quote

The hex value for TANH would clarify any problem.
Code:
program mterr
use iso_fortran_env
implicit none
integer i,ix,it
real x,tnhx,f
!
write (*,*) compiler_version()
print *
print *,'            x     x(IEEE hex) tanh(hex)      tanh(x)     1/x - 1/tanh(x)'
print *,'    -------------   --------  --------   -------------   ---------------'     
ix = Z'33DBE6F8'
do i=1,16
   x = transfer(ix,x)
   tnhx = tanh(x)
   it = transfer(tnhx,it)
   f = 1.0/x - 1.0/tnhx
   print 10,i,x,ix,it,tnhx,f
   ix = ix+1
end do
10 format(i2,ES16.7,1x,2Z10,ES16.7,ES15.5)
end program
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1884

PostPosted: Tue Mar 09, 2021 12:07 pm    Post subject: Reply with quote

John, I raised this issue on CLF.

A few of the responders who had older versions of Gfortran on Linux did report seeing the 1.0s in the output.

Most of them had a recent version of Gfortran on Linux, MacOS, or even Android (on a Nokia phone!), and did not see the error.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group