Jpp
Public Member Functions | Public Attributes | Friends | List of all members
SCIENTIFIC Struct Reference

Auxiliary data structure for floating point format specification. More...

#include <JPrint.hh>

Inheritance diagram for SCIENTIFIC:
WIDTH

Public Member Functions

 SCIENTIFIC (const int width, const int precision)
 Constructor. More...
 

Public Attributes

int precision
 
int width
 

Friends

std::ostream & operator<< (std::ostream &out, const SCIENTIFIC &format)
 Format specifier. More...
 

Detailed Description

Auxiliary data structure for floating point format specification.

Definition at line 518 of file JPrint.hh.

Constructor & Destructor Documentation

◆ SCIENTIFIC()

SCIENTIFIC::SCIENTIFIC ( const int  width,
const int  precision 
)
inline

Constructor.

Parameters
widthwidth
precisionprecision

Definition at line 527 of file JPrint.hh.

528  :
529  WIDTH(width)
530  {
531  this->precision = precision;
532  }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const SCIENTIFIC format 
)
friend

Format specifier.

Parameters
outoutput stream
formatformat
Returns
output stream

Definition at line 541 of file JPrint.hh.

542  {
543  using namespace std;
544 
545  return out << scientific << right << setw(format.width) << setprecision(format.precision);
546  }

Member Data Documentation

◆ precision

int SCIENTIFIC::precision

Definition at line 548 of file JPrint.hh.

◆ width

int WIDTH::width
inherited

Definition at line 292 of file JPrint.hh.


The documentation for this struct was generated from the following file:
WIDTH::WIDTH
WIDTH(const int width)
Constructor.
Definition: JPrint.hh:273
SCIENTIFIC::precision
int precision
Definition: JPrint.hh:548
std
Definition: jaanetDictionary.h:36
WIDTH::width
int width
Definition: JPrint.hh:292