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 

epsilon

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
pmsagdeo



Joined: 30 May 2007
Posts: 3

PostPosted: Sun Jun 17, 2007 1:44 am    Post subject: epsilon Reply with quote

The FTN 95 does not seem to have implemented epsilon. Intel FORTRAN 9.0 does. Any idea if this is going to implemented. Or is it there in the paid version. Thanks.

Pradip Sagdeo
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sun Jun 17, 2007 7:44 am    Post subject: Reply with quote

I am not familiar with the Intel Fortran epsilon.
It is not Standard Fortran and it is not implemented in any version of FTN95.

There is a Fortran 90 standard intrinsic called EPSILON that is available and gives

EPSILON(X) = b ** (1-p)

where ** means "raised to the power"
b is the base used by the processor
p is the number of significant digits in X.
Back to top
View user's profile Send private message AIM Address
pmsagdeo



Joined: 30 May 2007
Posts: 3

PostPosted: Sun Jun 17, 2007 12:47 pm    Post subject: epsilon Reply with quote

I tried to use it, but did not get the expected result. It did however function correctly under the INTEL compiler. Hence the question. Thanks.

Pradip
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sun Jun 17, 2007 5:08 pm    Post subject: Reply with quote

If you are saying that the standard intrinsic EPSILON is not giving the expected result could you post sample code together with the result and the result you expect.

Thanks.
Back to top
View user's profile Send private message AIM Address
pmsagdeo



Joined: 30 May 2007
Posts: 3

PostPosted: Sun Jun 17, 2007 6:26 pm    Post subject: epsilon Reply with quote

Yes, will do that as soon as I finish the business at hand. Thanks.

Pradip
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Jun 20, 2007 4:00 am    Post subject: Reply with quote

Pradip,

Do you have the correct kind value for your real variables ? You may have a more extensive error with differing default kinds.

program test
real*4 x4
real*8 x8
real*10 x10
write (*,*) 'real*4', epsilon (x4)
write (*,*) 'real*8', epsilon (xCool
write (*,*) 'real*10', epsilon (x10)
end program test

gives:
Program entered
real*4 1.192093E-07
real*8 2.220446049250E-16
real*10 1.08420217248550444E-19

What were you expecting ?

John
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 -> General All times are GMT + 1 Hour
Page 1 of 1

 
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