|
From: | Przemek Klosowski |
Subject: | Re: Some Octave newbie questions regarding number format and matrices |
Date: | Mon, 21 Sep 2009 08:21:37 -0400 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 |
On 09/20/2009 02:06 AM, Jordi GutiƩrrez Hermos wrote:
2009/9/19 hdfrango<address@hidden>:1. is there any way to force octave to express numbers in fraction form, to avoid loss of precision?If you don't want to lose precision, you need a symbolic CAS, like Sage or Maxima, not Octave.
True in general, but you can use the command 'format rat' to at least output the numbers as fractions: octave:7> 1/3 ans = 1/3 octave:8> pi ans = 355/113 There's also the rat() function that calculates rational approximations to numbers to a given tolerance.
[Prev in Thread] | Current Thread | [Next in Thread] |