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

indy transformation for receiver missing

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.2
    • Component/s: None
    • Labels:

      Description

      This code:

      import static java.lang.Math.*
      
        R = 1;  C1 = 0.4; C2 = 0.9;  C3 = 6
      
      
      //niters = getInt("How many iterations of the Ikeda map");
      niters = 200000
      x = new double[niters]
      y = new double[niters]
      x[0]=0.12; y[0]=0.2
      
      k=1
      km=0
        tau=0.0;  sintau=0.0;  costau=0.0
      
      while  (k< niters)  {
         km=k-1
         tau = C1-C3/(1+x[km]*x[km]+y[km]*y[km])
         sintau = sin(tau); costau = cos(tau);
         x[k] = R+C2*(x[km]*costau-y[km]*sintau)
         y[k] = C2*(x[km]*sintau+y[km]*costau)
      
         k++
      }
      

      fails with a cast exception complaining it cannot cast BigDecimal to double. The reason is that C1 - (C3/(1+x[km]*x[km]+y[km]*y[km])) is a BigDecimal-Double operation, for which a double,double method will be selected. This requires a transformation of the receiver from BigDecimal to double. The current code does this only for the arguments.

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              blackdrag Jochen Theodorou
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: