octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #53456] output_precision: Cannot set precision


From: Oliver Heimlich
Subject: [Octave-bug-tracker] [bug #53456] output_precision: Cannot set precision higher than 16
Date: Tue, 27 Mar 2018 18:48:20 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #3, bug #53456 (project octave):

Regarding floating-point numbers, num2str and printf are a valid workaround.
Although, I also found it comfortable to simply raise the number of digits
with output_precision for number output. IMO this is a valid feature for
numerical analysis tools. With the limitation to max. 16 digits, the function
becomes pretty useless for accuracy explorations.

Another use case of mine is to control output for the interval package, where
the output_precision function has been used to set the number of desired
digits. With directed (outward) rounding of floating-point numbers it becomes
interesting to set the precision to 17 to see inclusion properties of
intervals. Without any alternative, I probably have to come up with a
different solution now.

The num2str function is not suitable for the interval package, but I'd like to
implement printf support for the interval type. Unfortunately, the built-in
*printf functions do not allow to be extended with custom types (m-file
classes). I can't even make use of the printf_format_list class, because it is
not part of the public API. So, it probably is not a good idea to override the
*printf methods.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53456>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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