From: lionel@quark.zko.dec.com (Steve Lionel)
Subject: Re: Problems with overflows in DEC Fortran 90
Date: 1997/04/07 [thread overview]
Message-ID: <5ibfdk$k7g@usenet.pa.dec.com> (raw)
In-Reply-To: 334926C4.41C6@latoso.cheme.cornell.edu
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.
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.
--
Steve Lionel mailto:lionel@quark.zko.dec.com
Fortran Development http://www.digital.com/info/slionel.html
Digital Equipment Corporation
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698 "Free advice is worth every cent"
For information on DIGITAL Fortran, see http://www.digital.com/fortran
next prev parent 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 [this message]
1997-04-07 4:00 ` Jeffrey Potoff
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