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

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

[Octave-bug-tracker] [bug #53167] format long doesn't adjust precision t


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #53167] format long doesn't adjust precision to 7 digits when displaying single() values
Date: Mon, 19 Feb 2018 19:31:21 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #5, bug #53167 (project octave):

The following is essentially what Octave does now when you set
output_precision to 75:


#include <cmath>
#include <iomanip>
#include <iostream>

int
main (void)
{
  std::cout.flags (std::ios::showpoint);
  std::cout << std::setprecision (70) << std::setw (75) << M_PI << std::endl;
  return 0;
}


On my system, this prints:


     3.141592653589793115997963468544185161590576171875000000000000000000000


I believe this is the same as


#include <math.h>
#include <stdio.h>

int
main (void)
{
  printf ("%80.75f\n", M_PI);
  return 0;
}


Maybe it's stupid, but when these format functions were originally written for
Octave, I think the aim was to allow this kind of formatting.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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