[
https://issues.apache.org/jira/browse/GROOVY-7129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King updated GROOVY-7129:
------------------------------
Description:
Exponent math returns a different class type for the value compared to using
.getClass() on the normal number.
This appears to occur when raising 2 to exponents between 31 and 62.
{noformat}
groovy:000> 2147483648.getClass()
===> class java.lang.Long
groovy:000> (2 ** 31).getClass()
===> class java.math.BigInteger
{noformat}
Test case attached.
was:
Exponent math returns a different class type for the value compared to using
.getClass() on the normal number.
This appears to occur when raising 2 to exponents between 31 and 62.
groovy:000> 2147483648.getClass()
===> class java.lang.Long
groovy:000> (2 ** 31).getClass()
===> class java.math.BigInteger
Test case attached.
> Exponent integer classes differ
> -------------------------------
>
> Key: GROOVY-7129
> URL: https://issues.apache.org/jira/browse/GROOVY-7129
> Project: Groovy
> Issue Type: Bug
> Environment: Mac OSX 10.10, Groovy 2.3.7, JVM 1.8.0_20
> Reporter: Rick Briganti
> Priority: Minor
> Attachments: FooTest.groovy
>
>
> Exponent math returns a different class type for the value compared to using
> .getClass() on the normal number.
> This appears to occur when raising 2 to exponents between 31 and 62.
> {noformat}
> groovy:000> 2147483648.getClass()
> ===> class java.lang.Long
> groovy:000> (2 ** 31).getClass()
> ===> class java.math.BigInteger
> {noformat}
> Test case attached.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)