From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Sergey Kaplun <skaplun@tarantool.org>, Maxim Kokryashkin <m.kokryashkin@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit] x86/x64: Fix math.ceil(-0.9) result sign. Date: Thu, 9 Nov 2023 16:26:29 +0300 [thread overview] Message-ID: <8b05c3f3-7c71-4960-ae08-1bb707793485@tarantool.org> (raw) In-Reply-To: <20231102123616.10527-1-skaplun@tarantool.org> Hi, Sergey thanks for the patch! LGTM see a minor comment below On 11/2/23 15:36, Sergey Kaplun wrote: <snipped> > +++ 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)
next prev parent reply other threads:[~2023-11-09 13:26 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-11-02 12:36 Sergey Kaplun via Tarantool-patches 2023-11-07 9:44 ` Maxim Kokryashkin via Tarantool-patches 2023-11-07 10:21 ` Sergey Kaplun via Tarantool-patches 2023-11-07 10:50 ` Maxim Kokryashkin via Tarantool-patches 2023-11-09 13:26 ` Sergey Bronnikov via Tarantool-patches [this message] 2023-11-09 14:32 ` Sergey Kaplun via Tarantool-patches 2023-11-09 16:04 ` Sergey Bronnikov via Tarantool-patches 2023-11-23 6:31 ` Igor Munkin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=8b05c3f3-7c71-4960-ae08-1bb707793485@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=m.kokryashkin@tarantool.org \ --cc=sergeyb@tarantool.org \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit] x86/x64: Fix math.ceil(-0.9) result sign.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox