35 #ifndef OPENMS_CONCEPT_PRECISIONWRAPPER_H
36 #define OPENMS_CONCEPT_PRECISIONWRAPPER_H
50 template <
typename FloatingPo
intType>
58 FloatingPointType
const ref_;
96 template <
typename FloatingPo
intType>
103 template <
typename FloatingPo
intType>
104 inline std::ostream & operator<<(std::ostream & os, const PrecisionWrapper<FloatingPointType> & rhs)
107 #pragma clang diagnostic push
108 #pragma clang diagnostic ignored "-Wfloat-equal"
109 if (rhs.ref_ != rhs.ref_)
110 #pragma clang diagnostic pop
118 const std::streamsize prec_save = os.precision();
121 os.precision(prec_save);
Int writtenDigits(const FloatingPointType &=FloatingPointType())
Number of digits commonly used for writing a floating point type (a.k.a. precision). Specializations are defined for float, double, long double.
Definition: Types.h:288
const PrecisionWrapper< FloatingPointType > precisionWrapper(const FloatingPointType rhs)
Wrapper function that sets the appropriate precision for output temporarily. The original precision i...
Definition: PrecisionWrapper.h:97
PrecisionWrapper(const FloatingPointType rhs)
Constructor. Note: Normally you will prefer to use the "make"-function precisionWrapper(), which see.
Definition: PrecisionWrapper.h:54
Wrapper class to implement output with appropriate precision. See precisionWrapper().
Definition: PrecisionWrapper.h:51
FloatingPointType const ref_
Definition: PrecisionWrapper.h:58
PrecisionWrapper(const PrecisionWrapper &rhs)
Definition: PrecisionWrapper.h:56