Message374927
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. |
|
Date |
User |
Action |
Args |
2020-08-06 11:13:39 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, rhettinger, veky, pablogsal, Jeffrey.Kintscher |
2020-08-06 11:13:38 | mark.dickinson | set | messageid: <1596712418.98.0.589571995229.issue41458@roundup.psfhosted.org> |
2020-08-06 11:13:38 | mark.dickinson | link | issue41458 messages |
2020-08-06 11:13:38 | mark.dickinson | create | |
|