Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Re: Problems with overflows in DEC Fortran 90
  1997-04-07  4:00 Problems with overflows in DEC Fortran 90 Jeffrey Potoff
  1997-04-07  4:00 ` Paul DeMone
@ 1997-04-07  4:00 ` Steve Lionel
  1997-04-07  4:00   ` Jeffrey Potoff
  1 sibling, 1 reply; 5+ messages in thread
From: Steve Lionel @ 1997-04-07  4:00 UTC (permalink / raw)




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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Problems with overflows in DEC Fortran 90
@ 1997-04-07  4:00 Jeffrey Potoff
  1997-04-07  4:00 ` Paul DeMone
  1997-04-07  4:00 ` Steve Lionel
  0 siblings, 2 replies; 5+ messages in thread
From: Jeffrey Potoff @ 1997-04-07  4:00 UTC (permalink / raw)



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.

Jeff



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problems with overflows in DEC Fortran 90
  1997-04-07  4:00 ` Steve Lionel
@ 1997-04-07  4:00   ` Jeffrey Potoff
  0 siblings, 0 replies; 5+ messages in thread
From: Jeffrey Potoff @ 1997-04-07  4:00 UTC (permalink / raw)



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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problems with overflows in DEC Fortran 90
  1997-04-07  4:00 Problems with overflows in DEC Fortran 90 Jeffrey Potoff
@ 1997-04-07  4:00 ` Paul DeMone
  1997-04-08  4:00   ` Steve Lionel
  1997-04-07  4:00 ` Steve Lionel
  1 sibling, 1 reply; 5+ messages in thread
From: Paul DeMone @ 1997-04-07  4:00 UTC (permalink / raw)



Jeffrey Potoff wrote:
> 
> 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.

   No suprise if xlf is mianframe based.  The 360 family and its
   descendents use a base 16 floating point representation.  This
   buys larger range of exponents at cost of precision and slightly
   more complex FP hardware. 

> 
> Jeff

--
Paul W. DeMone                 The 801 experiment SPARCed an ARMs race
Kanata, Ontario                to put more PRECISION and POWER into
demone@mosaid.com              architectures with MIPSed results but
PaulDeMone@EasyInternet.net    ALPHA's well that ends well.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problems with overflows in DEC Fortran 90
  1997-04-07  4:00 ` Paul DeMone
@ 1997-04-08  4:00   ` Steve Lionel
  0 siblings, 0 replies; 5+ messages in thread
From: Steve Lionel @ 1997-04-08  4:00 UTC (permalink / raw)




In article <3349AD6D.64C8@EasyInternet.net>, Paul DeMone 
<PaulDeMone@EasyInternet.net> writes:

|>   No suprise if xlf is mianframe based.  The 360 family and its
|>   descendents use a base 16 floating point representation.  This
|>   buys larger range of exponents at cost of precision and slightly
|>   more complex FP hardware. 

No, xlf is on IBM's RS/6000 UNIX boxes which use IEEE floating.  But even
the IBM 360 float representation didn't go as far as 1E100 in single
precision - it was something like 1E75 or thereabouts.
-- 

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-04-08  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-04-07  4:00 Problems with overflows in DEC Fortran 90 Jeffrey Potoff
1997-04-07  4:00 ` Paul DeMone
1997-04-08  4:00   ` Steve Lionel
1997-04-07  4:00 ` Steve Lionel
1997-04-07  4:00   ` Jeffrey Potoff

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