Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3397

BigInteger losts precition during conversion to BigInteger using 'as' keyword

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6
    • 1.6.1, 1.7-beta-1
    • groovy-jdk
    • None
    • Patch

    Description

      Following test case failed with:
      junit.framework.AssertionFailedError: expected:<9223372036854775808> but was:<-9223372036854775808>

      value = new BigInteger(Long.MAX_VALUE) + 1
      value2 = value as BigInteger
      assertEquals(value, value2)

      Attachments

        1. BigInteger.patch
          0.9 kB
          Alexey Utkin

        Activity

          People

            blackdrag Jochen Theodorou
            alx-ut Alexey Utkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: