X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/14d26b44a1d7eee67837ec0ea8fb0368ac6fe33e..04f3bbde6d6b93956a689555a665a47db71fd3ed:/numeric.c diff --git a/numeric.c b/numeric.c index fae2eb3..db8197c 100644 --- a/numeric.c +++ b/numeric.c @@ -227,6 +227,12 @@ C is set in C<*flags> on entry. If C is set in C<*flags> then the binary number may use C<"_"> characters to separate digits. +=for apidoc Amnh||PERL_SCAN_ALLOW_UNDERSCORES +=for apidoc Amnh||PERL_SCAN_DISALLOW_PREFIX +=for apidoc Amnh||PERL_SCAN_GREATER_THAN_UV_MAX +=for apidoc Amnh||PERL_SCAN_SILENT_ILLDIGIT +=for apidoc Amnh||PERL_SCAN_TRAILING + =cut Not documented yet because experimental is C will point to one byte past the end of the recognized string. If the recognition fails, zero is returned, and C<*sp> will not move. +=for apidoc Amn|bool|IS_NUMBER_GREATER_THAN_UV_MAX +=for apidoc Amn|bool|IS_NUMBER_INFINITY +=for apidoc Amn|bool|IS_NUMBER_IN_UV +=for apidoc Amn|bool|IS_NUMBER_NAN +=for apidoc Amn|bool|IS_NUMBER_NEG +=for apidoc Amn|bool|IS_NUMBER_NOT_INT + =cut */ @@ -1408,10 +1421,6 @@ Perl_my_atof(pTHX_ const char* s) #if defined(NV_INF) || defined(NV_NAN) -#ifdef USING_MSVC6 -# pragma warning(push) -# pragma warning(disable:4756;disable:4056) -#endif static char* S_my_atof_infnan(pTHX_ const char* s, bool negative, const char* send, NV* value) { @@ -1489,9 +1498,6 @@ S_my_atof_infnan(pTHX_ const char* s, bool negative, const char* send, NV* value } return NULL; } -#ifdef USING_MSVC6 -# pragma warning(pop) -#endif #endif /* if defined(NV_INF) || defined(NV_NAN) */ @@ -1554,7 +1560,7 @@ Perl_my_atof3(pTHX_ const char* orig, NV* value, const STRLEN len) /* strtold() accepts 0x-prefixed hex and in POSIX implementations, 0b-prefixed binary numbers, which is backward incompatible */ - if ((len == 0 || len >= 2) && *s == '0' && + if ((len == 0 || len - (s-orig) >= 2) && *s == '0' && (isALPHA_FOLD_EQ(s[1], 'x') || isALPHA_FOLD_EQ(s[1], 'b'))) { *value = 0; return (char *)s+1; @@ -1757,7 +1763,7 @@ Perl_isinfnan(NV nv) } /* -=for apidoc +=for apidoc isinfnansv Checks whether the argument would be either an infinity or C when used as a number, but is careful not to trigger non-numeric or uninitialized