diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2015-01-25 09:42:19 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-01-28 06:52:31 -0500 |
commit | fae4db12fe48a8d53b803281652815abd8bc98c0 (patch) | |
tree | b0b229295fd2d300e98d7899beabdd2c95990331 /numeric.c | |
parent | 0c5a1073d3e8debefdaa5b534337acb1b0c060ef (diff) | |
download | perl-fae4db12fe48a8d53b803281652815abd8bc98c0.tar.gz |
infnan: Allow 1.#INF00 and 1.#IND00
Windowese for inf and nan. The exact number of trailing zeros seems
to vary, maybe controlled by printf precision? Or RTL dependent?
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -650,13 +650,21 @@ Perl_grok_infnan(const char** sp, const char* send) !(isALPHA_FOLD_EQ(*s, 'Y') || isALPHA_FOLD_EQ(*s, 'E'))) return 0; s++; if (s < send) return 0; - } else if (*s) - return 0; + } else { + while (*s == '0') { /* 1.#INF00 */ + s++; + } + if (*s) + return 0; + } flags |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT; } else if (isALPHA_FOLD_EQ(*s, 'D') && odh) { /* 1.#IND */ s++; flags |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT; + while (*s == '0') { /* 1.#IND00 */ + s++; + } } else return 0; } |