Input format and NaNs



I have a datafile that I'm trying to read that has NaNs in it, on
occasion, where the result of a calculation in another language was a NaN.
Where there aren't NaNs there are floating point numbers.

Is there a format specifier I can use that won't puke on NaN in the input
stream, or do I have to read things into a string, check for NaN and then
using an internal read if there isn't a NaN or preprocess the file with
something else to replace the NaNs with a "known bad value" that FORTRAN
can read on it's own?

Using Salford f95 compiler, if it makes a difference.

TIA,
Bruce

--
+-------------------+---------------------------------------------------+
Bruce Bowler | A person is never happy except at the price of some
1.207.633.9600 | ignorance. - Anatole France
bbowler@xxxxxxxxxxx |
+-------------------+---------------------------------------------------+

.



Relevant Pages

  • =?ISO-8859-1?Q?B=E0rdachd_Gh=E0idhlig_le_Ruaraidh_MacThomais=2E?=
    ... Poetry, by its very nature makes little deliberate errors; ... words to remind us that Gaelic is a living language and can deal more ... Consider the first line - Nam bu dia mi - Were I a god... ... Comar nan Allt is Milton Keynes is Surbiton - ...
    (soc.culture.scottish)
  • Re: Division by zero: float vs. int
    ... they simply cannot be represented as reals. ... prefer to invoke the complex plane -- "this calculation has two values neither ... So the NaN result is a meta-level assertion shoe-horned into IEEE FP ...
    (comp.lang.java.programmer)
  • Re: reals uncertainties
    ... >What you show above alone will certainly not cause a NaN. ... >would contribute would be to take a different branch on occasion if the ... unless it's the result of that branch causing a ... edition Salford at the very reasonable price of free. ...
    (comp.lang.fortran)
  • Re: Meaning of Double.Epsilon
    ... >> sort an array of doubles (at least with generics, ... > NaN is just for that purpose: If a value is NaN it stays NaN even if used ... like these have to be values that cannot be result of a calculation. ... converting it to an int will throw an ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: reals uncertainties
    ... >>What you show above alone will certainly not cause a NaN. ... >>would contribute would be to take a different branch on occasion if the ... unless it's the result of that branch causing a ...
    (comp.lang.fortran)