Closed RandomInEqualities closed 5 years ago
That's a pretty old thing (https://svn.boost.org/trac10/ticket/9400), there are various corner cases in exponents handling...
This has been fixed in Qi in real_impl.hpp. The best strategy is to unify the code in one place. I'll see what I can do. What are the other corner cases, @Kojoley ?
@Kojoley, I'll take this one. Please tell me what other corner cases you are referring to.
@RandomInEqualities Fix is in develop.
Thanks, I tested the patch locally, it works well for me.
There is one regression, but I don't really care about that, but it is that "2.1111111e-303" cannot be parsed anymore due to the (exp-frac) in scale(int exp, int frac, T& n)
, while it looks like scale(int exp, T& n) has some support for exponents lower than min_exp, so it could be parsed before. (But I think just rejecting is totally fine, e.g one would have to do 2.11111...111e-5 with 303 ones to see it in practice).
Good you checked. I'll have a look later. Should be easy. Thanks!
Fixed for big negative exponents. Please try again before I close this.
Yes, again thanks a lot. It works great now.
The following code:
Asserts in pow10.hpp:
Due to the exponentiation table only holding 308 values. In qi the expression is rejected.
One can use their own real policy to workaround it: