World Ocean Simulation System (WOSS) library
custom-precision-double.h File Reference

Provides the interface for the woss::PDouble class. More...

Go to the source code of this file.

Classes

class  woss::PDouble
 Custom precision long double class. More...
 

Namespaces

namespace  woss
 

Functions

constexpr PDouble woss::operator+ (const PDouble &left, const PDouble &right)
 
constexpr PDouble woss::operator- (const PDouble &left, const PDouble &right)
 
constexpr PDouble woss::operator/ (const PDouble &left, const PDouble &right)
 
constexpr PDouble woss::operator* (const PDouble &left, const PDouble &right)
 
constexpr PDouble woss::operator% (const PDouble &left, const PDouble &right)
 
constexpr PDoublewoss::operator+= (PDouble &left, const PDouble &right)
 
constexpr PDoublewoss::operator-= (PDouble &left, const PDouble &right)
 
constexpr PDoublewoss::operator/= (PDouble &left, const PDouble &right)
 
constexpr PDoublewoss::operator*= (PDouble &left, const PDouble &right)
 
constexpr PDoublewoss::operator%= (PDouble &left, const PDouble &right)
 
constexpr bool woss::operator== (const PDouble &left, const PDouble &right)
 
constexpr bool woss::operator!= (const PDouble &left, const PDouble &right)
 
constexpr bool woss::operator> (const PDouble &left, const PDouble &right)
 
constexpr bool woss::operator< (const PDouble &left, const PDouble &right)
 
constexpr bool woss::operator>= (const PDouble &left, const PDouble &right)
 
constexpr bool woss::operator<= (const PDouble &left, const PDouble &right)
 
std::ostream & woss::operator<< (std::ostream &os, const PDouble &instance)
 
std::istream & woss::operator>> (std::istream &is, PDouble &instance)
 

Detailed Description

Provides the interface for the woss::PDouble class.

Author
Federico Guerra

Provides the interface for the PDouble class. PDouble stands for PrecisionDouble: the value and the precision provided are used for arithmetic computations and comparisons. This class is not intented for inheritance: all containers used in WOSS are based on PDouble objects, not pointers to objects. Therefore, inheritance requires modification in other classes, to prevent object slicing when inserting in containers PDouble-derived objects instead of PDouble objects. Moreover, due to intensive use of PDouble objects, using heap-based pointers adds another layer of indirection, therefore adding an efficiency penalty.