#include <decimal_reference.hpp>
◆ const_reference
◆ difference_type
◆ reference
◆ self_type
◆ size_type
◆ value_type
◆ decimal_reference() [1/3]
Constructs a decimal reference for the given layout and index.
- Parameters
-
layout | Pointer to the layout containing the decimal data |
index | Index of the decimal element in the layout |
- Precondition
- layout must not be nullptr
-
index must be valid within the layout bounds
- Postcondition
- Reference is bound to the specified element
-
Layout pointer and index are stored for future operations
- Examples
- /home/runner/work/sparrow/sparrow/include/sparrow/layout/decimal_reference.hpp.
Definition at line 260 of file decimal_reference.hpp.
◆ decimal_reference() [2/3]
◆ decimal_reference() [3/3]
◆ operator double()
Conversion to double.
Converts the referenced decimal value to a double-precision floating-point representation. Provides better precision than float conversion.
- Returns
- Double approximation of the decimal value
- Precondition
- value_type::integer_type must not be a placeholder type
- Postcondition
- Return value approximates the decimal's mathematical value
-
Better precision than float conversion
Definition at line 332 of file decimal_reference.hpp.
◆ operator float()
Conversion to float.
Converts the referenced decimal value to a floating-point representation. May lose precision for large values or high-precision decimals.
- Returns
- Float approximation of the decimal value
- Precondition
- value_type::integer_type must not be a placeholder type
- Postcondition
- Return value approximates the decimal's mathematical value
-
May lose precision due to float's limited precision
Definition at line 325 of file decimal_reference.hpp.
◆ operator long double()
Conversion to long double.
Converts the referenced decimal value to a long double floating-point representation. Provides the highest precision among floating-point conversions.
- Returns
- Long double approximation of the decimal value
- Precondition
- value_type::integer_type must not be a placeholder type
- Postcondition
- Return value approximates the decimal's mathematical value
-
Highest precision among floating-point conversions
Definition at line 339 of file decimal_reference.hpp.
◆ operator std::string()
Conversion to string representation.
Converts the referenced decimal value to its human-readable string representation with proper decimal point placement.
- Returns
- String representation of the decimal value
- Precondition
- value_type::integer_type must not be a placeholder type
- Postcondition
- Returns exact string representation of the decimal
-
Format matches decimal's string conversion rules
◆ operator<=>()
◆ operator=() [1/4]
Copy assignment from another decimal reference.
- Parameters
-
rhs | Source decimal reference to copy from |
- Returns
- Reference to this object
- Precondition
- rhs must be valid (pointing to valid layout and index)
- Postcondition
- This reference's target is assigned the value from rhs
-
rhs remains unchanged
Definition at line 288 of file decimal_reference.hpp.
◆ operator=() [2/4]
Copy assignment from a decimal value.
- Parameters
-
rhs | Decimal value to copy assign |
- Returns
- Reference to this object
- Precondition
- Layout must remain valid during assignment
-
Index must be within layout bounds
- Postcondition
- Underlying layout element is assigned the copied value
-
rhs remains unchanged
Definition at line 274 of file decimal_reference.hpp.
◆ operator=() [3/4]
◆ operator=() [4/4]
Move assignment from a decimal value.
- Parameters
-
rhs | Decimal value to move assign |
- Returns
- Reference to this object
- Precondition
- Layout must remain valid during assignment
-
Index must be within layout bounds
- Postcondition
- Underlying layout element is assigned the moved value
-
rhs is moved from and may be in unspecified state
Definition at line 267 of file decimal_reference.hpp.
◆ operator==()
◆ scale()
◆ storage()
◆ value()
The documentation for this class was generated from the following file: