Mark Dickinson <dicki...@gmail.com> added the comment:

If we want to do this (and I'm still not convinced that we do), I think there's 
a simpler way: use `frexp` to decompose each float into a fraction and an 
exponent, multiply the fractions (which barring zeros will all be in [0.5, 
1.0)), and keep track of the accumulated exponents separately. Then combine 
everything at the end.

There's a possibility of the accumulated product of the fractions underflowing, 
but only every 1000 floats or so, so it's enough to check every 500 floats 
(say) whether the product is smaller than 2**-500 or not, and scale by 2**1000 
(adjusting the exponent correspondingly) if not.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41458>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to