From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,30a4338557379910,start X-Google-Attributes: gid1164f8,public From: lionel@quark.zko.dec.com (Steve Lionel) Subject: Re: Problems with overflows in DEC Fortran 90 Date: 1997/04/07 Message-ID: <5ibfdk$k7g@usenet.pa.dec.com>#1/1 X-Deja-AN: 231350712 Distribution: world Sender: lionel@quark.enet.dec.com (Steve Lionel) References: <334926C4.41C6@latoso.cheme.cornell.edu> Organization: Digital Equipment Corporation, Nashua NH Reply-To: lionel@quark.zko.dec.com (Steve Lionel) Newsgroups: comp.sys.dec 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. 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