help-octave
[Top][All Lists]
Advanced

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

Re: Bug?


From: Marco Atzeri
Subject: Re: Bug?
Date: Wed, 22 Jun 2016 09:04:40 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 22/06/2016 08:11, Mike Miller wrote:
On Tue, Jun 21, 2016 at 23:20:15 +0200, Marco Atzeri wrote:

%d means decimal format not integer

Actually, %d does mean the argument is expected to be an integer.
However, Matlab has the interesting “feature” that if the argument has
more precision than the format specifier, then it is formatted as a
floating point number anyway, overriding whatever you asked for. Octave
4.0 and later should do this correctly, see

  http://www.octave.org/NEWS-4.0.html


The manual says differently:

https://www.gnu.org/software/octave/doc/v4.0.1/Formatted-Output.html#XREFprintf

"This example shows the use of the ‘%d’ conversion to specify that a scalar argument should be printed in decimal notation"



reply via email to

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