[Top][All Lists]

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

[Octave-bug-tracker] [bug #53166] format long displays 15 significant di

From: Michael Leitner
Subject: [Octave-bug-tracker] [bug #53166] format long displays 15 significant digits, rather than 15 digits after decimal point (Matlab Compatibility)
Date: Thu, 22 Feb 2018 05:41:46 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #6, bug #53166 (project octave):

No, that's not what I meant. What does Matlab print when with format long you
display just the single values pi* 10 or pi* 100, all by themselves? Octave
displays always 15 digits. One could argue that Octave could also display 16
digits (I am not in favour of this, as it can pretend to have accuracy that is
not there). However, Matlab according to its documentation at
https://de.mathworks.com/help/matlab/ref/format.html gives you "fixed-decimal
format with 15 digits after the decimal point for double values". Therefore,
pi has one digit before the decimal point, giving you 16 digits overall, but
pi*10 has two digits before the decimal point, giving you 17 digits and so on.
Of course this would be nonsense (therefore my claim that this is either a
Matlab bug or a Matlab documentation bug) UNLESS Matlab changes over to %e (in
printf terminology) for all non-integer values >=10, because then there is
always just one digit before the decimal point. So please somebody try what
Matlab gives for



Reply to this item at:


  Message sent via/by Savannah

reply via email to

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