#14085: powModInteger sometimes ignores sign of argument -------------------------------------+------------------------------------- Reporter: ocheron | Owner: ocheron Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 8.2.1 Resolution: | Keywords: integer-gmp Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3826 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"c5605ae00e9bff90db7a5f24ff3b8de2aba3b55b/ghc" c5605ae0/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="c5605ae00e9bff90db7a5f24ff3b8de2aba3b55b" Make function intToSBigNat# preserve sign (fixes #14085) Impacts only functions gcdExtInteger, powModInteger and recipModInteger which gave invalid results on negative S# inputs. Also fixes gcdExtInteger assertion when first argument is negative. Test Plan: Updated test case integerGmpInternals Reviewers: austin, hvr, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14085 Differential Revision: https://phabricator.haskell.org/D3826 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14085#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler