This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/gfortran] Fix handling of subnormal numbers
On Thu, Apr 14, 2005 at 07:57:22PM +0200, Tobias Schl?ter wrote:
> Tobias Schl?ter wrote:
> > We'll need this because we will want to model target arithmetic precisely,
> > including precision loss. Say for a contrived example, someone wants to
> > determine the exponent range and does something like
> > x = 1.5; y = 1.5; i = 1
> > DO WHILE (y==x)
> > y = x**(-i)
> > y = x**i
> > i = i + 1
> > END DO
> > ! Precision loss occured, i is now abs(minexponent) + precision
> > ! (possibly off-by-one)
>
> It's amazing how many mistakes I made in those few lines.
> x = 1.5; y = 1.5; i = 1
> DO WHILE (y==x)
> y = x*(2.**(-i))
> y = y*(2.**i)
> i = i + 1
> END DO
> This is more like what I intended.
>
I just ran paranoia from netlib (spara.f and dpara.f).
It found no problems with the subnormal stuff I just
committed. I'll, however, think about rth's truncation.
--
Steve