[Top][All Lists]

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

Re: Number Precision

From: Etienne Grossmann
Subject: Re: Number Precision
Date: Tue, 31 Jul 2001 20:56:58 GMT


From: Kent Nguyen <address@hidden>

# I would like to know how to increase the precision size of a result.  For 
# example, when I what to find the sqrt(2), the answer octave gave was 1.4142.  
# Rather I want to increase that precision to like 1.414213562.

  Use the output_precision and output_max_field_width variables : 

octave:57>  output_precision 
output_precision = 5
octave:58>  output_precision = 10
output_precision = 10
octave:59> sqrt (2)
ans = 1.414213562e+00
octave:60> output_max_field_width = 12
output_max_field_width = 12
octave:61> sqrt (2)
ans = 1.414213562
octave:62> help outpu
output_max_field_width  output_precision        
octave:62> help output_max_field_width 
output_max_field_width is a built-in variable

 - Built-in Variable: output_max_field_width
     This variable specifies the maximum width of a numeric output
     field.  The default value is 10.

octave:63> help output_precision       
output_precision is a built-in variable

 - Built-in Variable: output_precision
     This variable specifies the minimum number of significant figures
     to display for numeric output.  The default value is 5.



Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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