From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 01F1064ED28; Thu, 9 Nov 2023 16:26:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 01F1064ED28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1699536393; bh=6yNKn+BuMhJe0npnnV+8ALE7GE2TKUtqzdRLNXUqBbs=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=qwjMU2tCLzKHpoAwyQH37RhtTTuxXdLl39DZgxzrsU/4Z09Bo1ajMZd6kT+un17ux jAmrFU3ayiPiQb9J/s/ECJ7ee4VRAF8Dy2OeSON/lnWER4oxTqoIruL/FX16usalDj WZEkosPyWHwF1Xh16ctweQr4lG/Dlo648N0t7GLQ= Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [95.163.41.88]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6BB46404481 for ; Thu, 9 Nov 2023 16:26:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6BB46404481 Received: by smtp52.i.mail.ru with esmtpa (envelope-from ) id 1r153F-00GiXT-1x; Thu, 09 Nov 2023 16:26:30 +0300 Message-ID: <8b05c3f3-7c71-4960-ae08-1bb707793485@tarantool.org> Date: Thu, 9 Nov 2023 16:26:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <20231102123616.10527-1-skaplun@tarantool.org> In-Reply-To: <20231102123616.10527-1-skaplun@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9C2A6B03AB739174C6C1832769EA9286E0D6FE4A60DB83BBE00894C459B0CD1B9D8F6F53E68B23265DBCEDD10356E18F3535ACA7A687BC16031CC4806F04841A8 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F5B0FEFE70B13B25EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C5BAFDCCAC60DA968638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D821D7726C09F6535DAE4C627A74046151117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3733B5EC72352B9FA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F2CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE9647ADFADE5905B107FB45A5F6E725C8D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE3632EDEA9CD5989A39735652A29929C6CC4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CD2DCF9CF1F528DBC2E808ACE2090B5E1725E5C173C3A84C317B107DEF921CE79089D37D7C0E48F6C8AA50765F7900637EC0FE244295A6067EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A505AE068925FCBB4B7E54778E5C9ABEB144291DE55C21DD7DF87CCE6106E1FC07E67D4AC08A07B9B082B967D547A19D2FCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF630D824D02A4F1ED2F73FA5F5E58B3A9D71A429030F40BABE8C636436079CE70614F3626C4CAF433D0DB820CB2E38D8B534BB0CDD759FA2A9238FC3DCEE6EB01E48CAC7CA610320002C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKdAcnY08CHLbyZ0aa+10TA== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769D03F7CAE1331D74FD92B8DACC09EF57BBA0848438379BFCEEBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] x86/x64: Fix math.ceil(-0.9) result sign. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey thanks for the patch! LGTM see a minor comment below On 11/2/23 15:36, Sergey Kaplun wrote: > +++ b/test/tarantool-tests/lj-859-math-ceil-sign.test.lua > @@ -0,0 +1,20 @@ > +local tap = require('tap') > + > +-- Test file to demonstrate the incorrect LuaJIT's behaviour > +-- for `math.ceil(x)` when argument `x`: -1 < x < -0.5. > +-- See also https://github.com/LuaJIT/LuaJIT/issues/859. > + > +local test = tap.test('lj-859-math-ceil-sign') > + > +test:plan(1) > + > +local IS_DUALNUM = tostring(tonumber('-0')) ~= tostring(-0) > +local IS_X86_64 = jit.arch == 'x86' or jit.arch == 'x64' > + > +-- Use `tostirng()` to compare sign of the returned value. tostirng -> tostring > +-- Take any value from the mentioned range. Chosen one is > +-- mentioned in the commit message. > +test:ok((IS_DUALNUM and IS_X86_64) or tostring(math.ceil(-0.9)) == '-0', > + 'correct zero sign') > + > +test:done(true)