help-octave
[Top][All Lists]
Advanced

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

Re: Problem with precision


From: Marco atzeri
Subject: Re: Problem with precision
Date: Thu, 16 Jun 2011 17:09:28 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

On 6/16/2011 4:34 PM, Fritz Fischer wrote:
Hello!

I have a problem with Octave's precision and hope that you can help me.

My function writes data to a file, usually using a normal precision. But
some
values are written with a very high precision and in the exponential format:

44.875
40.262
35.327
30.005
20.981
6.9638e-28
0
0

Can someone tell me how to fix this? I tried format short and format long
but the output is the same at both settings.

Since the files are used as input for another program that does not
understand the exponential format I need to change this.

Kind regards,
Walter

see

"14.2.4 Formatted Output"

— Built-in Function: fprintf (fid, template, ...)

This function is just like printf, except that the output is written to the stream fid instead of stdout. If fid is omitted, the output is written to stdout.

"14.2.7 Table of Output Conversions"

‘%f’
    Print a floating-point number in normal (fixed-point) notation

Regards
Marco


reply via email to

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