This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Separate grok_infnan() from grok_number().
Remaining issues:
(1) would need tests, but there are two problems: [a] generating inf/nan
reliably and testing for it from Perl level is hard (see items (2) and
(3) below), and [b] the behavior of various systems with especially NaN
differs (some platforms might throw SIGFPEs).
(2) toke.c:scan_number() will not call this code (via grok_number)
because "NaN" or "Inf" do not look at all like floats to it.
(3) Even as we now recognize these forms, the native strtod()
might not (problem of cross-portability of these exceptional
forms: Win32 outputs e.g. "1.#INF", what Linux reading this should do,
or conversely Linux outputs "Inf", what should Win32 do?)