numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class of floating numbers in a custom number system with given radix. More...
#include <num_collect/numbers/custom_float.h>
Public Types | |
using | digit_calc_type = DigitCalc |
Type of digits for calculation. | |
using | digit_type = Digit |
Type of digits. | |
Public Member Functions | |
custom_float () | |
Construct zero. | |
auto | at (index_type index) const -> digit_type |
Access a digit with checks. | |
auto | highest_ind () const noexcept -> index_type |
Get the index of the highest digit. | |
auto | lowest_ind () const noexcept -> index_type |
Get the index of the lowest digits. | |
void | move_digits (index_type offset) |
Move digits. | |
auto | operator[] (index_type index) -> digit_type & |
Access a digit preparing it if needed. | |
auto | operator[] (index_type index) const -> digit_type |
Access a digit without checks. | |
void | push_to_highest (digit_type digit) |
Add a digit to the highest end. | |
void | push_to_lowest (digit_type digit) |
Add a digit to the lowest end. | |
void | resize (index_type lowest, index_type highest) |
Change the range of digits. | |
Static Public Attributes | |
static constexpr index_type | radix = Radix |
Radix of the number system. | |
Private Attributes | |
util::bidirectional_vector< digit_type > | digits_ |
Digits. | |
Class of floating numbers in a custom number system with given radix.
Radix | Radix of the number system. |
Digit | Type of digits. |
DigitCalc | Type of digits for calculation. |
Definition at line 41 of file custom_float.h.
using num_collect::numbers::custom_float< Radix, Digit, DigitCalc >::digit_calc_type = DigitCalc |
Type of digits for calculation.
Definition at line 54 of file custom_float.h.
using num_collect::numbers::custom_float< Radix, Digit, DigitCalc >::digit_type = Digit |
Type of digits.
Definition at line 51 of file custom_float.h.
|
inline |
Construct zero.
Definition at line 59 of file custom_float.h.
|
inlinenodiscard |
Access a digit with checks.
[in] | index | Index. |
Definition at line 89 of file custom_float.h.
|
inlinenodiscardnoexcept |
Get the index of the highest digit.
Definition at line 79 of file custom_float.h.
|
inlinenodiscardnoexcept |
Get the index of the lowest digits.
Definition at line 70 of file custom_float.h.
|
inline |
Move digits.
[in] | offset | Offset from the current places of digits. |
Definition at line 136 of file custom_float.h.
|
inlinenodiscard |
Access a digit preparing it if needed.
[in] | index | Index. |
Definition at line 113 of file custom_float.h.
|
inlinenodiscard |
Access a digit without checks.
[in] | index | Index. |
Definition at line 101 of file custom_float.h.
|
inline |
Add a digit to the highest end.
[in] | digit | Digit. |
Definition at line 129 of file custom_float.h.
|
inline |
Add a digit to the lowest end.
[in] | digit | Digit. |
Definition at line 122 of file custom_float.h.
|
inline |
Change the range of digits.
[in] | lowest | Index of lowest digits. |
[in] | highest | Index of the highest digit. |
Definition at line 144 of file custom_float.h.
|
private |
Digits.
Definition at line 150 of file custom_float.h.
|
staticconstexpr |
Radix of the number system.
Definition at line 48 of file custom_float.h.