From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,30a4338557379910 X-Google-Attributes: gid1164f8,public From: Jeffrey Potoff Subject: Re: Problems with overflows in DEC Fortran 90 Date: 1997/04/07 Message-ID: <3349908D.167E@latoso.cheme.cornell.edu>#1/1 X-Deja-AN: 231412217 Sender: jjp7@cornell.edu (Verified) References: <334926C4.41C6@latoso.cheme.cornell.edu> <5ibfdk$k7g@usenet.pa.dec.com> Organization: Cornell University Newsgroups: comp.sys.dec Steve Lionel wrote: > > In article <334926C4.41C6@latoso.cheme.cornell.edu>, Jeffrey Potoff > 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