Uploaded image for project: 'BlueJ'
  1. BlueJ
  2. BLUEJ-365

CodePad not casting some values correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: 3.0.5
    • Fix Version/s: 3.0.6
    • Component/s: CodePad

      Description

      This worked in 3.0.4 but is now broken in 3.0.5. In CodePad, evaluate the following:

      > (double) -5
      -5.0 (double) Correct

      > (int) -5
      -5 (int) Correct

      > (double) 4
      4.0 (double) Correct

      > (int) 4
      4 (int) Correct

      > (int) -5.4
      -5.0 (double) Not correct. Should be -5 (int)

      > (byte) -5.3
      -5.0 (double) Should be -5 (byte)

      > (float) -1.0
      -1.0 (double) Not correct, wrong type

      > (double) -5.2
      -5.2 (double) Correct

      > (float) -5.2
      -5.199999809265137 (double) Maybe correct value, but wrong type

      > -5.2F
      -5.2 (float) Correct

      > System.out.println((int) -5.4);
      Outputs -5, which is correct

        Attachments

          Activity

            People

            • Assignee:
              davmac Davin McCall
              Reporter:
              external External via trac
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: