push
github
Revert to trival pow() optimizations to prevent inaccuracies. (cherry-picked from commit 96d6d5032) This patch fixes different misbehaviours between JIT-compiled code and the interpreter for power operator in the following ways: * Drop folding optimizations for base ^ n => base * base ..., as far as pow(base, n) isn't interchangeable with just multiplicity of numbers and depends on the <math.h> implementation. * Since the internal power function is inaccurate for very big or small powers, it is dropped, and `pow()` from the standard library is used instead. To save consistency between JIT behaviour and the VM, narrowing optimization is dropped, and only trivial folding optimizations are used. Also, `math_extern2` version with two parameters is dropped, since it's no longer used. Also, this fixes failures of the [220/502] lib/string/format/num.lua test [1] from the LuaJIT-test suite. [1]: https://www.exploringbinary.com/incorrect-floating-point-to-decimal-conversions/ Sergey Kaplun: * added the description and the test for the problem Part of tarantool/tarantool#8825 Reviewed-by: Maxim Kokryashkin <m.kokryashkin@tarantool.org> Reviewed-by: Sergey Bronnikov <sergeyb@tarantool.org> Signed-off-by: Igor Munkin <imun@tarantool.org>
5325 of 5963 branches covered (0.0%)
Branch coverage included in aggregate %.
11 of 11 new or added lines in 5 files covered. (100.0%)
20446 of 23278 relevant lines covered (87.83%)
1286629.81 hits per line