'save_precision' doesn't work

Jaroslav Hajek highegg at gmail.com
Wed Dec 24 02:28:35 CST 2008


On Tue, Dec 23, 2008 at 10:47 PM, Sergei Steshenko <sergstesh at yahoo.com> wrote:
> Hello All,
>
> please see the session below - I expected much more significant digits in
> 'foo.txt' file.
>
>
> Thanks,
>  Sergei.
>
> The session:
>
> octave:1> save_precision(30);
> octave:2> output_precision(30);
> octave:3> foo = 1/3
> foo =  3.33333333333333314829616256247e-01
> octave:4> save('-ascii', 'foo.txt', 'foo');
> octave:5> system('cat foo.txt');
>  3.33333333e-01
> octave:6> version
> ans = 3.0.3
> octave:7>
>

Well, this is, in fact, correct. The help for save_precision says that
it's the default precision for the "text" format (save -text), not the
"ascii" format.
The ascii format has a precision of 8 digits. The best option here is
probably to support also -double and -tabs for -ascii. Currently,
they're unsupported.

cheers

-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


More information about the Bug-octave mailing list