Class representing formatting options for output (stearming) of doubles. More...
#include <FormDouble.h>
Public Member Functions | |
template<typename T > | |
const formdouble::Bound< T > | operator() (const T &) const |
Binds a value of a double-based type (e.g. double, dcomp, std::vector<double> , etc.) to the present instant. | |
Constructors | |
FormDouble (int precision, int width) | |
Generic constructor. | |
FormDouble (int precision) | |
Constructor calculating an appropriate width from the maximal possible width of a number of the given precision in the representation of the given machine. | |
Getters | |
int | getPrecision () const |
int | getWidth () const |
Static Public Attributes | |
static const int | defaultPrecision |
Ultimate default precision for streaming doubles for the whole framework. | |
static int | overallPrecision |
Generic overall precision accessible throughout the framework. More... | |
Related Functions | |
(Note that these are not member functions.) | |
int | actualPrecision (int precision) |
If precision is larger than FormDouble::defaultPrecision, returns precision , otherwise the default. More... | |
int | widthPositive (int precision) |
The maximal width in characters of a positive number streamed with the given precision More... | |
int | widthAny (int precision) |
The maximal width in characters of any (positive or negative) number streamed with the given precision More... | |
const FormDouble | low () |
Generic “low” precision (FormDouble::defaultPrecision/2 ) More... | |
const FormDouble | high () |
Generic “high” precision (FormDouble::defaultPrecision ) More... | |
const FormDouble | positive (int precision) |
const FormDouble | zeroAdditional (int precision) |
Class representing formatting options for output (stearming) of doubles.
It handles two characteristics, the precision (number of digits) and width of the output, where the latter can also be left calculated automatically by FormDouble::FormDouble(int)
Definition at line 35 of file FormDouble.h.
|
related |
If precision
is larger than FormDouble::defaultPrecision, returns precision
, otherwise the default.
Definition at line 77 of file FormDouble.h.
|
related |
Generic “high” precision (FormDouble::defaultPrecision
)
Definition at line 98 of file FormDouble.h.
|
related |
Generic “low” precision (FormDouble::defaultPrecision/2
)
Definition at line 97 of file FormDouble.h.
|
related |
precision | FormDouble with at least FormDouble::defaultPrecision for positive-only quantities, such as time |
Definition at line 101 of file FormDouble.h.
|
related |
The maximal width in characters of any (positive or negative) number streamed with the given precision
|
related |
The maximal width in characters of a positive number streamed with the given precision
|
related |
precision | FormDouble with at least FormDouble::defaultPrecision and without additional width (padding) |
Definition at line 104 of file FormDouble.h.
|
static |
Generic overall precision accessible throughout the framework.
Can be set by reading in any variable of class FormDouble from the command line through the parameter-bundle.
Definition at line 45 of file FormDouble.h.