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

calling method having a Bigdecimal parameter with a long produces incorrect bigdecimal

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.6
    • Fix Version/s: 2.4.8
    • Component/s: groovy-jdk, groovy-runtime
    • Labels:
      None
    • Environment:
      linux

      Description

      Assume the following example:

      def x = Random.newInstance().nextLong()
      
      def asBigDecimal(BigDecimal bd){
          println "bigdecimal value is $bd"
      }
      
      println "long value is $x"
      asBigDecimal(x)
      

      This will produce two different print outs.
      My expecation is that the printed numbers are equal.

        Attachments

          Activity

            People

            • Assignee:
              aalmiray Andres Almiray
              Reporter:
              detlef_brendle Detlef Brendle
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: