You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/10/28 10:37:00 UTC
[jira] [Updated] (GROOVY-10800) The % operator returns unexpected results for negative numbers for BigIntegers
[ https://issues.apache.org/jira/browse/GROOVY-10800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King updated GROOVY-10800:
-------------------------------
Description:
As a follow-up to GROOVY-10786, the behavior of the % operator for BigInteger is a little strange for negative numbers.
{code}
def nums = [-10, -10L, -10f, -10d, -10G, -10.0G]
assert nums.collect{ it % 3 } == [-1, -1, -1f, -1d, 2G, -1.0G]
{code}
was:
As a follow-up to GROOVY-10786, the behavior of the % operator for BigInteger is a little strange for negative numbers.
> The % operator returns unexpected results for negative numbers for BigIntegers
> ------------------------------------------------------------------------------
>
> Key: GROOVY-10800
> URL: https://issues.apache.org/jira/browse/GROOVY-10800
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
> Priority: Major
>
> As a follow-up to GROOVY-10786, the behavior of the % operator for BigInteger is a little strange for negative numbers.
> {code}
> def nums = [-10, -10L, -10f, -10d, -10G, -10.0G]
> assert nums.collect{ it % 3 } == [-1, -1, -1f, -1d, 2G, -1.0G]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)