[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: Setting Precision

**From**: |
Paul Kienzle |

**Subject**: |
Re: Setting Precision |

**Date**: |
Wed, 18 Sep 2002 11:15:37 -0400 |

To change the displayed precision you can use the following:
octave:3> output_precision = 3
output_precision = 3
octave:4> pi
pi = 3.14
To change the calculated precision, you can try using the symbolic
toolbox available from octave-forge (http://octave.sf.net). I say
"try" because it doesn't work like I expect, but I don't know if that
is a bug in my expectations or in the code:
octave:40> symbols
octave:41> digits(3)
ans = 3
octave:42> x = vpa(pi)
x =
3.1416
octave:43> sin(x)
ans = -8.91e-06
octave:44> sin(pi)
ans = 1.22e-16
octave:45> vpa(2)/vpa(3)
ans =
0.666664
Paul Kienzle
address@hidden
On Wed, Sep 18, 2002 at 12:14:19PM -0300, Diego Ruiz Moreno wrote:
>* Hello to all,*
>* I ' m using OCTAVE to teaching Numerical Analysis and I want that *
>* the students make some calculation with different precision .... Is this *
>* possible ? Is possible to change the number of digit that octave shows *
>* on the screen (I mean if I ask for PI, Octave answer 3.1416, but I know *
>* that there are more decimals )?*
>* *
>* Thanks.*
>* *
>* Diego*
>* *
>* *
>* *
>* -------------------------------------------------------------*
>* 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*
>* -------------------------------------------------------------*
>* *
-------------------------------------------------------------
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
-------------------------------------------------------------