On Sat, 3 Mar 2018, Ioannis A. Venetis wrote:
I am not sure if this question has been placed before.
I run the following
<hansl>
set verbose off
set seed 1059999
scalar n = 5
scalar k = 5
matrix A = mrandgen(i,-4,4,n,k)
scalar a = -15
print A
eval a*A
B=a*A
print B
</hansl>
which evaluates a -0 in a*A[4,2] position or prints zero in B[4,2]
position. Can this be avoided?
If your concern is purely aesthethic, then you could use
<hansl>
A .= -0 ? 0 : A
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------