Uploaded image for project: 'SystemDS'
  1. SystemDS
  2. SYSTEMDS-1816

toString can return -0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • SystemML 0.15
    • Runtime
    • None

    Description

      When display matrix values with toString, -0 can be displayed.

      Example:

      m = matrix("50 99 100 200",rows=2,cols=2);
      x = 100;
      m = (m - x) * ((m-x) >= 0)
      print(toString(m))
      

      gives:

      -0.000 -0.000
      0.000 100.000
      

      Using as.scalar on the individual cells returns 0:

      for (i in 1:nrow(m)) {
          for (j in 1:ncol(m)) {
              n = m[i,j]
              print('[' + i + ',' + j + ']:' + as.scalar(n))
          }
      }
      

      gives:

      [1,1]:0.0
      [1,2]:0.0
      [2,1]:0.0
      [2,2]:100.0
      

      Attachments

        Activity

          People

            nakul02 Nakul Jindal
            deron Jon Deron Eriksson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: