In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c62e754c9aa399aa832a4bebf95b9ce8d3f119b2?hp=7635ad4d3786f55dd8a3434152f7df096e87148e>
- Log ----------------------------------------------------------------- commit c62e754c9aa399aa832a4bebf95b9ce8d3f119b2 Author: Jarkko Hietaniemi <[email protected]> Date: Sun Oct 12 17:43:48 2014 -0400 Tru64: S_mulexp10 overflow help. M numeric.c commit 48853916f1deeece371d9b1b11543cc6a077e916 Author: Jarkko Hietaniemi <[email protected]> Date: Sun Oct 12 17:11:02 2014 -0400 infnan: if the mulexp10 value goes to zero, return it. M numeric.c ----------------------------------------------------------------------- Summary of changes: numeric.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/numeric.c b/numeric.c index ab42efc..171f593 100644 --- a/numeric.c +++ b/numeric.c @@ -1029,12 +1029,25 @@ S_mulexp10(NV value, I32 exponent) exponent--; value /= 10; } + if (value == 0.0) + return value; #endif } +#if defined(__osf__) + /* Even with cc -ieee + ieee_set_fp_control(IEEE_TRAP_ENABLE_INV) + * Tru64 fp behavior on inf/nan is somewhat broken. Another way + * to do this would be ieee_set_fp_control(IEEE_TRAP_ENABLE_OVF) + * but that breaks another set of infnan.t tests. */ +# define FP_OVERFLOWS_TO_ZERO +#endif for (bit = 1; exponent; bit <<= 1) { if (exponent & bit) { exponent ^= bit; result *= power; +#ifdef FP_OVERFLOWS_TO_ZERO + if (result == 0) + return value < 0 ? -NV_INF : NV_INF; +#endif /* Floating point exceptions are supposed to be turned off, * but if we're obviously done, don't risk another iteration. */ -- Perl5 Master Repository
