You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@systemml.apache.org by "Nakul Jindal (JIRA)" <ji...@apache.org> on 2017/08/09 05:12:00 UTC
[jira] [Closed] (SYSTEMML-1816) toString can return -0
[ https://issues.apache.org/jira/browse/SYSTEMML-1816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nakul Jindal closed SYSTEMML-1816.
----------------------------------
> 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)