help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Zero or not?


From: Matthias Brennwald
Subject: Zero or not?
Date: Sat, 21 Jul 2007 14:50:59 +0200

Dear all

I expected the below code to yield only zeros, but it does not:

----------------------------
u = [ 0 , 1e-3 , 1e-4 ; 1e-3 , 0 , 0 ; 0 , 1e-4 , 0 ];
d = u - diag(sum(u));
sum(d)
----------------------------

The output is:
  0.0000e+00  -4.0658e-20   0.0000e+00

Why is this? Is there something I can do to 'fix' this?

Matthias


-------
Matthias Brennwald
Lägernstrasse 6
CH 8037 Zürich
+41 (0)44 364 17 03
address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]