![]() |
Boost.Real
1.0.0
Boost.Real numerical data type for real numbers representation using range arithmetic.
|
Explicitly represents a number as a vector of digits with a sign and an exponent. More...
#include <boundary.hpp>
Public Member Functions | |
| boundary ()=default | |
| default constructor: It construct a representation of the number zero. | |
| boundary (const boundary &other)=default | |
| Copy constructor: It construct a new boost::real::boundary that is a copy of the other boost::real::boundary. More... | |
| boundary & | operator= (const boundary &other)=default |
| Default asignment operator. More... | |
| bool | operator< (const boundary &other) const |
| Lower comparator operator: It compares the *this boost::real::boundary with the other boost::real::boundary to determine if *this is lower than other. More... | |
| bool | operator> (const boundary &other) const |
| Greater comparator operator: It compares the *this boost::real::boundary with the other boost::real::boundary to determine if *this is greater than other. More... | |
| bool | operator== (const boundary &other) const |
| Equality comparator operator: It compares the *this boost::real::boundary with the other boost::real::boundary to determine if *this and other are equals or not. More... | |
| std::basic_string< char > | as_string () const |
| Generates a string representation of the boost::real::boundary. More... | |
| void | swap (boundary &other) |
| Swaps the boost::real::boundary value with the value of the other boost::real::boundary. This operation is a more preformant form of swapping to boost::real::boundaries. More... | |
| void | push_back (int digit) |
| add the digit parameter as a new digit of the boost::real::boundary. The digit is added in the right side of the number. More... | |
| void | push_front (int digit) |
| add the digit parameter as a new digit of the boost::real::boundary. The digit is added in the left side of the number. More... | |
| void | normalize () |
| Removes extra zeros at the sides to convert the number representation into a normalized representation. | |
| void | normalize_left () |
| Removes extra zeros at the left side to convert the number representation into a semi normalized representation. | |
| void | clear () |
| ir clears the number digits. | |
| int & | operator[] (int n) |
| Returns the n-th digit of the boost::real::boundary. More... | |
| unsigned long | size () |
| It return the amount of digit of the boost::real::boundary. More... | |
Public Attributes | |
| std::vector< int > | digits = {} |
| int | exponent = 0 |
| bool | positive = true |
Explicitly represents a number as a vector of digits with a sign and an exponent.
|
default |
Copy constructor: It construct a new boost::real::boundary that is a copy of the other boost::real::boundary.
| other | - The boost::real::boundary to copy. |
|
inline |
Generates a string representation of the boost::real::boundary.
|
inline |
Lower comparator operator: It compares the *this boost::real::boundary with the other boost::real::boundary to determine if *this is lower than other.
| other | - The right side operand boost::real::boundary to compare with *this. |
Default asignment operator.
| other | - The boost::real::boundary to copy. |
|
inline |
Equality comparator operator: It compares the *this boost::real::boundary with the other boost::real::boundary to determine if *this and other are equals or not.
| other | - The right side operand boost::real::boundary to compare with *this. |
|
inline |
Greater comparator operator: It compares the *this boost::real::boundary with the other boost::real::boundary to determine if *this is greater than other.
| other | - The right side operand boost::real::boundary to compare with *this. |
|
inline |
Returns the n-th digit of the boost::real::boundary.
| n | - an int number indicating the index of the requested digit. |
|
inline |
add the digit parameter as a new digit of the boost::real::boundary. The digit is added in the right side of the number.
| digit | - The new digit to add. |
|
inline |
add the digit parameter as a new digit of the boost::real::boundary. The digit is added in the left side of the number.
| digit | - The new digit to add. |
|
inline |
It return the amount of digit of the boost::real::boundary.
|
inline |
Swaps the boost::real::boundary value with the value of the other boost::real::boundary. This operation is a more preformant form of swapping to boost::real::boundaries.
| other | - The boost::real::boundary to swap with *this. |