[CIQBUG] Problems with Doubles

[I sorry to be so unspecific at this point, but I have finish a project first before I can dive deeper into this.]

I have had a number of problems with Doubles lately in the simulator, but have not yet been able to deduct a specific test case.

Two problems:

I have a problem with the Math.atan(...) function, which only seems to be defined for Floats, but I think it have worked for Doubles sometimes as well. Hmm...

I have also seem problems in connection with the abs() method - which defined for both Doubles and Floats, but seems to fail occasionally for Doubles. More Hmmm

I typically get a report like this from the simulator:

Failed invoking <symbol>
Out Of Memory Error
@PC = 0x1000039e
@PC = 0x1000039e
@PC = 0x10000227
Out Of Memory Error
Out Of Memory Error


The PC mostly refers to lines where abs or atan is used, but may also sometimes refer to the Rez module.

If I "downgrade" my numbers to Floats (with toFloat()) everything seems to work just fine.
I think it might have something to do with String resources, but I'm not sure at all :D

I hope I can be more specific when I have some time to dive into the problem.
  • I have a very similar problem:

    System.println("Here 1!");

    var sinLambda = Math.sin(longitude);
    var cosLambda = Math.cos(longitude);

    System.println("Here 2!");

    var Height = 6378.0d; ///@TODO info object needs expand to provide altitude

    System.println("Here 3!");

    var eSq = (a*a - b*b) / (a*a);

    System.println("Here 4!");
    System.println("Here 5!");
    System.println("Here 6!");

    var nu = a / Math.sqrt(1 - eSq*sinPhi*sinPhi);

    System.println("Here 7!");


    resulting in:

    Shell Version -12782
    Here 1!
    Here 2!
    Here 3!
    Failed invoking <symbol>
    Out Of Memory Error
    @PC = 0x100002e3
    Out Of Memory Error
    Out Of Memory Error


    Out of interestm how do you convert the PC to a line of code? Do you have access to a dissambler or debugger?
  • Out of interestm how do you convert the PC to a line of code? Do you have access to a dissambler or debugger?


    I use the .prg.debug.xml file. You just have to convert the the PC value from hex to decimal and look it up in the file...

    I'll write a plugin to Eclipse that will do this automatically in the console as soon as I can find the time.