HRCore V1.1.0
A High Resolution Calculation Library
|
#include <Value.hpp>
Public Member Functions | |
Float (Float &&c) | |
Reload of move constructor. More... | |
Float (Integer &&c, int fpos, size_t tpos) | |
Float (const Float &c) | |
Reload of copy constructor. More... | |
Float (const Integer &c, int fpos=0, size_t tpos=0) | |
Copy value of Integer object and convert to a Float object. More... | |
Float & | operator= (Float &&c) |
Move operator. More... | |
Float & | operator= (const Float &c) |
Copy operator. More... | |
Float & | operator= (const double c) |
transform IEEE-754 Floating point value into Float object More... | |
size_t | precision () |
Get current precision of division and input. More... | |
void | precision (size_t n) |
Set precision of division and input. More... | |
Float | operator+ (const Float &s) |
Reload of operator+. More... | |
Float | operator- (const Float &s) |
Reload of operator-. More... | |
Float | operator* (const Float &s) |
Reload of operator*. More... | |
Float | operator/ (const Integer &s) |
Reload of operator/ (for Integer) More... | |
Float | operator/ (const Float &s) |
Reload of operator/ (for Float) More... | |
Integer | getInteger () |
Get Interger section. More... | |
bool | operator< (const Float &rhs) |
bool | operator> (const Float &rhs) |
bool | operator== (const Float &rhs) |
bool | operator>= (const Float &rhs) |
bool | operator<= (const Float &rhs) |
Integer (Storage::Interface *ptr, bool positive=true, bool autoRelease=false, bool sim=true) | |
Construct a new Integer object. More... | |
Integer (Integer &&c) | |
Move a Integer object. More... | |
Integer (const Integer &c) | |
Copy and construct a new Integer object. More... | |
Integer | make () |
Make a new object with same Interface type. More... | |
bool | positive () const |
Return the sign of object. More... | |
void | positive (bool p) |
Set the sign of object. More... | |
Static Public Member Functions | |
template<typename T > | |
static Integer | make () |
Construct a new Integer object using given type of Storage::Interface implement. More... | |
Protected Attributes | |
int | _fpos = 0 |
size_t | _tpos = 0 |
size_t | _precision = 10 |
Friends | |
std::istream & | operator>> (std::istream &is, Float &rhs) |
Reload of operator>> to support std::cin and other std::istream with Float. More... | |
std::ostream & | operator<< (std::ostream &os, Float &rhs) |
Reload of operator<< to support std::cout and other std::ostream with Integer. More... | |
Float type.
The class is a child of Integer; Somewhat like (IEEE-754)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Construct a new Integer object.
ptr | A pointer to a object of a class that implemented Storage::Interface |
positive | Decide whether the Integer object is positive or negative |
autoRelease | Specify if the ptr should be release autonomously after deconstruction |
sim | Decide if the data should be simplified first. (Internally) |
-1 | when the ptr is invalid. |
Exception::InvalidArgument | is throw when ptr is nullptr |
|
inlinestatic |
Construct a new Integer object using given type of Storage::Interface implement.
T | Type of Storage::Interface implement |
Definition at line 109 of file Value.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set precision of division and input.
The 'precision' use for input generate and division.
For input generation, the precision is the minimal precision. For division, the precision is the max precision.
To get actual precision, please make sure that both dividend and divider are generated from input with same precision.
n | The expected precision |
|
friend |
|
friend |