Silverfrost Forums

Welcome to our forums

epsilon

17 Jun 2007 12:44 #1975

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

17 Jun 2007 6:44 #1976

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.

17 Jun 2007 11:47 #1978

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

17 Jun 2007 4:08 #1979

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.

17 Jun 2007 5:26 #1980

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

Pradip

20 Jun 2007 3:00 #1983

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 real4 x4 real8 x8 real10 x10 write (,) 'real4', epsilon (x4) write (,) 'real8', epsilon (x8) write (,) 'real10', epsilon (x10) end program test

gives: Program entered real4 1.192093E-07 real8 2.220446049250E-16
real*10 1.08420217248550444E-19

What were you expecting ?

John

Please login to reply.