This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Separate grok_infnan() from grok_number().
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 18 Aug 2014 16:41:41 +0000 (12:41 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 20 Aug 2014 13:33:11 +0000 (09:33 -0400)
commitff4eb3984da9fdf3cec4f01cf752e4e7da44139f
tree9474354cb882578cd450a6b74a9f4d4eff6ee0bd
parent8b7fad815cf65ab870e666844e22045c74803f64
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?)
embed.fnc
embed.h
numeric.c
proto.h