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

BigDecimal to primtive conversion not working

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.5.5
    • Fix Version/s: None
    • Component/s: groovy-runtime
    • Labels:
      None

      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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nmccloud Kenneth Gendron
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: