Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Jeffrey Potoff <jpotoff@latoso.cheme.cornell.edu>
Subject: Re: Problems with overflows in DEC Fortran 90
Date: 1997/04/07	[thread overview]
Message-ID: <3349908D.167E@latoso.cheme.cornell.edu> (raw)
In-Reply-To: 5ibfdk$k7g@usenet.pa.dec.com


Steve Lionel wrote:
> 
> In article <334926C4.41C6@latoso.cheme.cornell.edu>, Jeffrey Potoff
> <jpotoff@latoso.cheme.cornell.edu> writes:
> |>I'm running DEC Fortran 90 under Digital Unix and it's having
> |>a hard time digesting numbers with large exponents.  If I do
> |>this:
> |>
> |>      program crap
> |>
> |>      double precision test
> |>
> |>      test = 1e100
> |>
> |>      end
> |>
> |>When I compile it gives me:
> |>
> |>90: Error: crap.f, line 5: When converting this constant to a
> |>REAL(KIND=4) number, underflow or overflow occurred.   [1E100]
> |>        test = 1e100
> |>
> |>?????  Under IBM's xlf I can run exponents up the 300.  Is there
> |>a way around this besides rewritting huge amounts of code.
> |>I'm hoping that I'm just missing something simple.
> 
> Yep - and I'm somewhat astonished that the IBM compiler let you get away with
> this.  1E100 is a *SINGLE PRECISION* constant, and is thus limited to a range
> of about 1E38.  If you want double-precision, use 1D100.  This is the
> standard way to do it.

The IBM compilers are fairly lax in many aspects as I've been finding
out now the I'm working with Digital Fortran.  The above 3 lines were
just a test...I've been tracking down some underflow/overflow errors
in a couple programs.

> 
> Digital's F77 compilers would let this go, and give you a double-precision
> value when assigned to a double-precision variable.  But Fortran 90 tightened
> up the rules regarding this and Digital Fortran 90 follows suit.  You can
> get the old behavior by compiling with -fpconstant.

Got it.  Thanks for the info.

Jeff



  reply	other threads:[~1997-04-07  4:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-07  4:00 Problems with overflows in DEC Fortran 90 Jeffrey Potoff
1997-04-07  4:00 ` Steve Lionel
1997-04-07  4:00   ` Jeffrey Potoff [this message]
1997-04-07  4:00 ` Paul DeMone
1997-04-08  4:00   ` Steve Lionel
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox