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

BigDecimal to primitive conversion not working

    XMLWordPrintableJSON

Details

    Description

      The following code will not compile with Groovy:

      Math.ceil(1/2)

      Groovy insists that it try to find Math.ceil(BigDecimal), as opposed to performing the conversion to a double.  The following will work though:

      Math.ceil((double)1/2)

      But the above should not be necessary as Groovy should unbox it.

      Incidentally, this did work with version 2.4.12 and below.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              nmccloud Kenneth Gendron
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: