Description
I would suggest we provide a function get_nan
and internally implement it by any of the approaches that were discussed (ieee_value
, sqrt
or huge
). That way we have just one simple place to modify, and the rest of stdlib uses get_nan
and thus does not have to be modified. We should discuss a good name for such a function.
Originally posted by @certik in #128 (comment)
There was some discussion in #128 about NaN
and how to generate it (not all compilers support ieee_arithmetic
and its function ieee_value
. Therefore, if could be nice to have such a function in stdlib
that would work for all compilers.
In #128, the following solutions were proposed:
-
ieee_value
(fromieee_arithmetic.f90
) -
sqrt
of a negative number (as implemented in gccieee_arithmetic.f90
) -
huge
(which does not returnNaN
??) @nshaffer -
Internal I/O to generate
NaN
(@urbanjost ) -
transfer
method (@leonfolks )
Possible name for this function: get_nan
Hopefully I didn't miss a proposition.