This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gfortran.dg/large_real_kind_1.f90


On Wed, Sep 28, 2005 at 12:23:09AM +0930, Alan Modra wrote:
> On Tue, Sep 27, 2005 at 10:06:28AM +0930, Alan Modra wrote:
> > The real problem is that huge() is actually returning infinity.  I'll
> > see if I can figure out why that is so.
> 
> This fixes the value returned by huge() for systems that use the IBM
> extended double format (or the mips variant) for long double.  It uses
> a similar hack to the one I made for c-cppbuiltin.c.
> See http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00388.html.
> Bootstrap and regression test powerpc64-linux in progress.
> 

Your patch appears to break the definition of the Fortran
model numbers as given in 13.7.1.  In particular,  if we
have

program a
   integer, parameter :: knd = 4 ! Set to IBM Extended kind to see problem.
   integer b, e, p
   real(knd) x,y
   b = radix(x)
   e = maxexponent(x)
   p = digits(x)
   x = huge(x)
   print*, x
   print*, (1._knd - real(b,knd)**(-p)) * real(b,knd)**(e-1) * b
end program a

The printed values need to be the same.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]