This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
More robust inf/nan recognition and generation.
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 24 Aug 2014 02:49:04 +0000 (22:49 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 25 Aug 2014 02:31:49 +0000 (22:31 -0400)
commit8c12dc63d1f47b22b69bbcfe5c21dcadb14c5397
tree49a27c8473749b45b7f71b3f4b4f2264b15772f6
parentb2bea0a9cc3975a6d0df1ebfa82cd24df518b9b0
More robust inf/nan recognition and generation.

Drop INFNAN_PEEK, premature optimization and hard to get right (it
basically imitates unrolled first half of grok_infnan).  Just keep
grok_infan fast.  (There is one spot in grok_number_flags() where we
peek at the next byte to avoid wasted work.)

If falling back (from not having NV_INF/NV_NAN) to the native strtod
(or similar), fake the input based on the grok_infnan result.
Add last-resort ways to generate inf/nan.

Recognize explicit unary plus, like "+Inf", and "INFINITE".

In tests use cmp_ok(), fix typos, add tests.
numeric.c
t/op/infnan.t