systemml-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nakul Jindal (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SYSTEMML-1816) toString can return -0
Date Wed, 09 Aug 2017 05:12:00 GMT

     [ https://issues.apache.org/jira/browse/SYSTEMML-1816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nakul Jindal resolved SYSTEMML-1816.
------------------------------------
       Resolution: Fixed
    Fix Version/s: SystemML 1.0

Resolved in [PR 599|https://github.com/apache/systemml/pull/599]

> toString can return -0
> ----------------------
>
>                 Key: SYSTEMML-1816
>                 URL: https://issues.apache.org/jira/browse/SYSTEMML-1816
>             Project: SystemML
>          Issue Type: Bug
>          Components: Runtime
>            Reporter: Deron Eriksson
>            Assignee: Nakul Jindal
>             Fix For: SystemML 1.0
>
>
> When display matrix values with toString, -0 can be displayed.
> Example:
> {code}
> m = matrix("50 99 100 200",rows=2,cols=2);
> x = 100;
> m = (m - x) * ((m-x) >= 0)
> print(toString(m))
> {code}
> gives:
> {code}
> -0.000 -0.000
> 0.000 100.000
> {code}
> Using as.scalar on the individual cells returns 0:
> {code}
> for (i in 1:nrow(m)) {
>     for (j in 1:ncol(m)) {
>         n = m[i,j]
>         print('[' + i + ',' + j + ']:' + as.scalar(n))
>     }
> }
> {code}
> gives:
> {code}
> [1,1]:0.0
> [1,2]:0.0
> [2,1]:0.0
> [2,2]:100.0
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message