<HTML><BODY><div>Hi!</div><div>Thanks for the review!</div><div>Fixed your nits, the branch is force pushed.</div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Best regards,</div><div>Maxim Kokryashkin</div></div></div><div> </div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div> <blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16777718311414098919_BODY">Max,<br><br>Thanks for the patch! LGTM, but there are some nits below.<br><br>On 03.02.23, Maksim Kokryashkin via Tarantool-patches wrote:<br>> Follows up commit 9b6c0cd8eafdd2e5a8a7ac4b33f6e33b3d8a93b9<br>> ("Don't compile math.modf() anymore.").<br>><br>> This patch introduces the test case for the issue with<br>> compiled `math.modf`, that was fixed by disabling the<br>> compilation for it.<br>><br>> Part of tarantool/tarantool#7230<br><br>Minor: It follows up the ticket, not a part of it.<br><br>> ---<br>> Branch: <a href="https://github.com/tarantool/luajit/tree/fckxorg/modf-test" target="_blank">https://github.com/tarantool/luajit/tree/fckxorg/modf-test</a><br>> PR: <a href="https://github.com/tarantool/tarantool/pull/8251" target="_blank">https://github.com/tarantool/tarantool/pull/8251</a><br>><br>> test/tarantool-tests/math-modf.test.lua | 31 +++++++++++++++++++++++++<br>> 1 file changed, 31 insertions(+)<br>> create mode 100644 test/tarantool-tests/math-modf.test.lua<br>><br>> diff --git a/test/tarantool-tests/math-modf.test.lua b/test/tarantool-tests/math-modf.test.lua<br>> new file mode 100644<br>> index 00000000..2aaa5189<br>> --- /dev/null<br>> +++ b/test/tarantool-tests/math-modf.test.lua<br>> @@ -0,0 +1,31 @@<br>> +local tap = require('tap')<br>> +local test = tap.test('math-modf')<br>> +test:plan(1)<br>> +<br>> +local function isnan(x)<br>> + return x ~= x<br>> +end<br>> +<br>> +local function array_is_consistent(res)<br>> + for i = 1, #res - 1 do<br>> + if res[i] ~= res[i + 1] and not (isnan(res[i]) and isnan(res[i + 1])) then<br>> + return false<br>> + end<br>> + end<br>> + return true<br>> +end<br>> +<br>> +jit.opt.start('hotloop=1')<br>> +jit.on()<br><br>This line is excess.<br><br>> +<br>> +local modf = math.modf<br>> +local inf = math.huge<br>> +<br>> +local r1 = {nil, nil, nil, nil}<br>> +local r2 = {nil, nil, nil, nil}<br><br>Minor: I'd rather use table.new here to make it clearer.<br><br>> +<br>> +for i = 1, 4 do<br>> + r1[i], r2[i] = modf(inf)<br>> +end<br>> +<br>> +test:ok(array_is_consistent(r1) and array_is_consistent(r2), 'wrong modf')<br>> --<br>> 2.37.1 (Apple Git-137.1)<br>><br><br>--<br>Best regards,<br>IM</div></div></div></div></blockquote><div> </div></div></blockquote></BODY></HTML>