[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57663] printf output doc error
From: |
Francesco Potortì |
Subject: |
[Octave-bug-tracker] [bug #57663] printf output doc error |
Date: |
Sat, 25 Jan 2020 05:48:29 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0 |
Follow-up Comment #2, bug #57663 (project octave):
This is what I get (which in my opinion is the expected behaviour:
octave> version
ans = 5.1.0
octave> printf("%.2g ",10.^(-6:6)/3)
3.3e-07 3.3e-06 3.3e-05 0.00033 0.0033 0.033 0.33 3.3 33 3.3e+02 3.3e+03
3.3e+04 3.3e+05
I find this behaviour useful and expected.
In fact, I was looking for a method to set the number of significant digits
and a parameter called "precision" looks like the obvious choice.
I was surprised when I read the docs, as the behaviour I observe is the same
as it is for the printf function of the C library.
According to Mathworks' docs, Matlab's printf behaves this way as well.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57663>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/