Natural number.
More...
#include <Natural.h>
◆ Natural() [1/3]
TBTK::Natural::Natural |
( |
| ) |
|
|
inline |
◆ Natural() [2/3]
constexpr TBTK::Natural::Natural |
( |
unsigned int |
value | ) |
|
|
inlineconstexpr |
Constructor.
- Parameters
-
value | The value to initilize the Natural number with. |
◆ Natural() [3/3]
Constructs an Index from a serialization string.
- Parameters
-
serialization | Serialization string from which to construct the Natural number. |
mode | Mode with which the string has been serialized. |
◆ operator unsigned int()
constexpr TBTK::Natural::operator unsigned int |
( |
| ) |
const |
|
inlineconstexpr |
Type conversion operator.
◆ operator*=()
Multiplication assignment operator.
- Parameters
-
- Returns
- The Natural after the multiplication has occured.
◆ operator++() [1/2]
Natural& TBTK::Natural::operator++ |
( |
| ) |
|
|
inline |
Increment operator.
- Returns
- The Natural after the increment has occured.
◆ operator++() [2/2]
Natural TBTK::Natural::operator++ |
( |
int |
| ) |
|
|
inline |
Increment operator.
- Returns
- The Natural before the increment has occured.
◆ operator+=()
Addition assignment operator.
- Parameters
-
- Returns
- The Natural after the addition has occured.
◆ operator--() [1/2]
Natural& TBTK::Natural::operator-- |
( |
| ) |
|
|
inline |
Decrement operator.
- Returns
- The Natural after the decrease has occured.
◆ operator--() [2/2]
Natural TBTK::Natural::operator-- |
( |
int |
| ) |
|
|
inline |
Decrement operator.
- Returns
- The Natural before the decrease has occured.
◆ operator-=()
Subtraction assignment operator.
- Parameters
-
- Returns
- The Natural after the subtraction has occured.
◆ operator/=()
Division assignment operator.
- Parameters
-
- Returns
- The Natural after the division has occured.
◆ operator=()
Natural& TBTK::Natural::operator= |
( |
unsigned int |
rhs | ) |
|
|
inline |
Assignment operator.
- Parameters
-
value | The value to assign the Natural. |
- Returns
- The Natural after assignment has occured.
◆ serialize()
◆ from_json
void from_json |
( |
const nlohmann::json & |
j, |
|
|
Natural & |
natural |
|
) |
| |
|
friend |
Implements the Nlohmann interface for conversion from json.
- Parameters
-
j | The json input. |
natural | The Natural to convert to. |
◆ to_json
void to_json |
( |
nlohmann::json & |
j, |
|
|
const Natural & |
natural |
|
) |
| |
|
friend |
Implements the Nlohmann interface for conversion to json.
- Parameters
-
j | The json output. |
natural | The Natural to convert. |
The documentation for this class was generated from the following file: