TBTK
Need a break? Support the development by playing Polarity Puzzles
TBTK::Real Class Reference

Real number. More...

#include <Real.h>

Inheritance diagram for TBTK::Real:
TBTK::PseudoSerializable TBTK::Quantity::Quantity< Units, Exponents > TBTK::Quantity::Base< Units, Exponents > TBTK::Quantity::Derived< Units, Exponents >

Public Member Functions

 Real ()
 
constexpr Real (double value)
 
 Real (const std::string &serialization, Serializable::Mode mode)
 
constexpr operator double () const
 
Realoperator= (double rhs)
 
Realoperator+= (const Real &rhs)
 
Realoperator-= (const Real &rhs)
 
Realoperator*= (const Real &rhs)
 
Realoperator/= (const Real &rhs)
 
std::string serialize (Serializable::Mode mode) const
 

Detailed Description

Real number.

Constructor & Destructor Documentation

◆ Real() [1/3]

TBTK::Real::Real ( )
inline

Constructor.

◆ Real() [2/3]

constexpr TBTK::Real::Real ( double  value)
inlineconstexpr

Constructor.

Parameters
valueThe value to initilize the Real number with.

◆ Real() [3/3]

TBTK::Real::Real ( const std::string &  serialization,
Serializable::Mode  mode 
)
inline

Constructs an Index from a serialization string.

Parameters
serializationSerialization string from which to construct the Real number.
modeMode with which the string has been serialized.

Member Function Documentation

◆ operator double()

constexpr TBTK::Real::operator double ( ) const
inlineconstexpr

Type conversion operator.

◆ operator*=()

Real& TBTK::Real::operator*= ( const Real rhs)
inline

Multiplication assignment operator.

Parameters
rhsThe right hand side.
Returns
The Real after the multiplication has occured.

◆ operator+=()

Real& TBTK::Real::operator+= ( const Real rhs)
inline

Addition assignment operator.

Parameters
rhsThe right hand side.
Returns
The Real after the addition has occured.

◆ operator-=()

Real& TBTK::Real::operator-= ( const Real rhs)
inline

Subtraction assignment operator.

Parameters
rhsThe right hand side.
Returns
The Real after the subtraction has occured.

◆ operator/=()

Real& TBTK::Real::operator/= ( const Real rhs)
inline

Division assignment operator.

Parameters
rhsThe right hand side.
Returns
The Real after the division has occured.

◆ operator=()

Real& TBTK::Real::operator= ( double  rhs)
inline

Assignment operator.

Parameters
valueThe value to assign the Real.
Returns
The Real after assignment has occured.

◆ serialize()

std::string TBTK::Real::serialize ( Serializable::Mode  mode) const
inline

Serialize Real. Note that Real is PseudoSerializable rather than Serializable. This means that the Serializable interface is implemented non-virtually.

Parameters
modeSerialization mode.
Returns
Serialized string representation of the Real.

The documentation for this class was generated from the following file: