large_real_kind_1.f90 & huge()

Paul Brook paul@codesourcery.com
Thu Sep 8 18:20:00 GMT 2005


On Thursday 08 September 2005 19:10, Steve Ellcey wrote:
> I was wondering what the standard is for what value the huge() intrinsic
> should return.  The Fortran test gfortran.dg/large_real_kind_1.f90 is
> failing on HPPA HP-UX because huge() is returning " +Infinity" and the
> test seems to be expecting a large (non-infinite) number.
>
> This works in IA64 Linux & HP-UX because on those systems huge() returns
> "0.1189731495E+04933" and things work OK.  On HPPA HP-UX I get +Infinity.
>
> Is it OK for huge() to return +Infinity?

No.

Are you sure it's actually returning +infinity? My first guess would be that 
this is a bug in the IO library making an intermediate calculation overflow.

> Where is this intrinsic handled?  I couldn't find the source for it.

gfc_simplify_huge. The value is always known at compile time.

Paul



More information about the Fortran mailing list