|
World Ocean Simulation System (WOSS) library
|
Custom precision long double class. More...
#include <custom-precision-double.h>

Public Member Functions | |
| constexpr | PDouble (const long double input=0.0, const long double precision=PDOUBLE_DEFAULT_PRECISION) noexcept |
| PDouble (const PDouble ©) noexcept=default | |
| PDouble (PDouble &&tmp) noexcept=default | |
| ~PDouble () noexcept=default | |
| constexpr void | setPrecision (double value) noexcept |
| constexpr long double | getPrecision () const noexcept |
| constexpr long double | getValue () const noexcept |
| constexpr PDouble & | operator= (const PDouble ©) noexcept=default |
| constexpr PDouble & | operator= (PDouble &&tmp) noexcept=default |
| constexpr | operator int () const |
| constexpr | operator float () const |
| constexpr | operator double () const |
| constexpr | operator long double () const |
Protected Attributes | |
| long double | value |
| long double | precision |
Friends | |
| constexpr PDouble | operator+ (const PDouble &left, const PDouble &right) |
| constexpr PDouble | operator- (const PDouble &left, const PDouble &right) |
| constexpr PDouble | operator/ (const PDouble &left, const PDouble &right) |
| constexpr PDouble | operator* (const PDouble &left, const PDouble &right) |
| constexpr PDouble | operator% (const PDouble &left, const PDouble &right) |
| constexpr PDouble & | operator+= (PDouble &left, const PDouble &right) |
| constexpr PDouble & | operator-= (PDouble &left, const PDouble &right) |
| constexpr PDouble & | operator/= (PDouble &left, const PDouble &right) |
| constexpr PDouble & | operator*= (PDouble &left, const PDouble &right) |
| constexpr PDouble & | operator%= (PDouble &left, const PDouble &right) |
| constexpr bool | operator== (const PDouble &left, const PDouble &right) |
| constexpr bool | operator!= (const PDouble &left, const PDouble &right) |
| constexpr bool | operator> (const PDouble &left, const PDouble &right) |
| constexpr bool | operator< (const PDouble &left, const PDouble &right) |
| constexpr bool | operator>= (const PDouble &left, const PDouble &right) |
| constexpr bool | operator<= (const PDouble &left, const PDouble &right) |
| std::ostream & | operator<< (std::ostream &os, const PDouble &instance) |
| std::istream & | operator>> (std::istream &is, PDouble &instance) |
Custom precision long double class.
The PDouble class stores a long double value and a long double precision for arithmetic computation and comparison purposes.
|
inlineconstexprnoexcept |
PDouble constructor
| input | value to store |
| precision | custom precision |
References precision, and value.
Referenced by operator!=, operator%, operator%=, operator*, operator*=, operator+, operator+=, operator-, operator-=, operator/, operator/=, operator<, operator<<, operator<=, operator=(), operator=(), operator==, operator>, operator>=, operator>>, PDouble(), and PDouble().
|
defaultnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
PDouble destructor. It is not virtual, since this class is not meant to be inherited from
|
inlineconstexprnoexcept |
Returns the custom precison
References precision.
Referenced by WossUnitTest::testPDouble().
|
inlineconstexprnoexcept |
Returns the custom value
References value.
Referenced by WossUnitTest::testPDouble().
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
Sets a custom precison
| value | desired precision |
References precision, setPrecision(), and value.
Referenced by setPrecision().

|
friend |
|
friend |
|
protected |
stored precision
Referenced by getPrecision(), operator!=, operator%, operator*, operator+, operator-, operator/, operator==, PDouble(), and setPrecision().
|
protected |
stored value
Referenced by getValue(), operator double(), operator float(), operator int(), operator long double(), operator!=, operator%, operator%=, operator*, operator*=, operator+, operator+=, operator-, operator-=, operator/, operator/=, operator<, operator<<, operator<=, operator==, operator>, operator>=, operator>>, PDouble(), and setPrecision().