Die Unendlichkeit in Fortran

Was ist der sicherste Weg, um eine variable zu +Infinity in Fortran? Im moment bin ich mit:

program test
  implicit none
  print *,infinity()
contains
  real function infinity()
    implicit none
    real :: x
    x = huge(1.)
    infinity = x + x
  end function infinity
end program test

aber ich Frage mich, ob es einen besseren Weg gibt?

InformationsquelleAutor astrofrog | 2011-02-15
Schreibe einen Kommentar