[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange problem
From: |
Gerald Ebberink |
Subject: |
Re: strange problem |
Date: |
Fri, 28 Nov 2003 10:51:42 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030912 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
It is not just representation. This was hust one in a series of 4000
matrix multiplications in a script. It gave me the problem of a
impossible answer,a negative distance in a optical system (this is
possible just not in the system I'm building).
So one of the problems is this number is negative.
Also this problem strikes me as a problem early calculators had.
you know the 1/3 * 3 =0.99999999 problem.
then there is a third thing I would like to point out.
as you can see in your own example -1/100 = -0.01 and not
- -0.01000000000000000020817 which would give you the 2.0817e-17
Geraint Paul Bevan wrote:
| Gerald,
|
| just to follow up to my earlier answer, if the purposes of your
| calculation are just for demonstration, the command "format bank" will
| set Octave to print only two decimal places; it only changes the
| display, however, not the underlying representation so calculations will
| not be affected.
|
| octave:1> format bank
| octave:2> a = [ 1 , 100 ; 0 , 1 ] * [ 1 , 0 ; -1/100 , 1 ]
| a =
|
| ~ -0.00 100.00
| ~ -0.01 1.00
|
|
| --
| Geraint Bevan
| http://homepage.ntlworld.com/geraint.bevan
|
- --
Ing. Gerald Ebberink
Laser Technician
Kernfysisch Versneller Instituut
Rijksuniversiteit Groningen
Zernikelaan 25
9747 AA Groningen
The Netherlands
tel: +31 50 363 3518
lab: +31 50 363 3588
fax: +31 50 363 4003
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/xxqubSbfYz8yWIMRAljHAJoCfnGzA/Kc8NEc9yVe/d7aRoV05wCgtwiZ
E4QcevhwD0w5OensMy/8mmw=
=LFzj
-----END PGP SIGNATURE-----
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
Message not available
- Re: strange problem,
Gerald Ebberink <=
strange problem, John W. Eaton, 2003/11/28
RE: strange problem, THOMAS Paul Richard, 2003/11/28
RE: strange problem, THOMAS Paul Richard, 2003/11/28