|
Lightweight 0.20251201.0
|
#include <SqlNumeric.hpp>
Public Member Functions | |
| constexpr | SqlNumeric (SqlNumeric &&) noexcept=default |
| constexpr SqlNumeric & | operator= (SqlNumeric &&) noexcept=default |
| constexpr | SqlNumeric (SqlNumeric const &) noexcept=default |
| constexpr SqlNumeric & | operator= (SqlNumeric const &) noexcept=default |
| constexpr | SqlNumeric (std::floating_point auto value) noexcept |
| Constructs a numeric from a floating point value. | |
| constexpr | SqlNumeric (SQL_NUMERIC_STRUCT const &value) noexcept |
| Constructs a numeric from a SQL_NUMERIC_STRUCT. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr void | assign (std::floating_point auto inputValue) noexcept |
| Assigns a value to the numeric. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr SqlNumeric & | operator= (std::floating_point auto value) noexcept |
| Assigns a floating point value to the numeric. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE auto | ToUnscaledValue () const noexcept |
| Converts the numeric to an unscaled integer value. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE float | ToFloat () const noexcept |
| Converts the numeric to a floating point value. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE double | ToDouble () const noexcept |
| Converts the numeric to a double precision floating point value. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE long double | ToLongDouble () const noexcept |
| Converts the numeric to a long double precision floating point value. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE | operator float () const noexcept |
| Converts the numeric to a floating point value. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE | operator double () const noexcept |
| Converts the numeric to a double precision floating point value. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE | operator long double () const noexcept |
| Converts the numeric to a long double precision floating point value. | |
| LIGHTWEIGHT_FORCE_INLINE std::string | ToString () const |
| Converts the numeric to a string. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE std::weak_ordering | operator<=> (SqlNumeric const &other) const noexcept |
| template<std::size_t OtherPrecision, std::size_t OtherScale> | |
| constexpr LIGHTWEIGHT_FORCE_INLINE bool | operator== (SqlNumeric< OtherPrecision, OtherScale > const &other) const noexcept |
Public Attributes | |
| SQL_NUMERIC_STRUCT | sqlValue {} |
| double | nativeValue {} |
Static Public Attributes | |
| static constexpr auto | Precision = ThePrecision |
| Number of total digits. | |
| static constexpr auto | Scale = TheScale |
| Number of digits after the decimal point. | |
| static constexpr auto | ColumnType = SqlColumnTypeDefinitions::Decimal { .precision = Precision, .scale = TheScale } |
Represents a fixed-point number with a given precision and scale.
Precision is exactly the total number of digits in the number, including the digits after the decimal point.
Scale is the number of digits after the decimal point.
Definition at line 38 of file SqlNumeric.hpp.
|
inlineconstexprnoexcept |
Constructs a numeric from a floating point value.
Definition at line 64 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::assign().
|
inlineexplicitconstexprnoexcept |
Constructs a numeric from a SQL_NUMERIC_STRUCT.
Definition at line 70 of file SqlNumeric.hpp.
|
inlineconstexprnoexcept |
Assigns a value to the numeric.
Definition at line 79 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::Precision, and Lightweight::SqlNumeric< ThePrecision, TheScale >::Scale.
Referenced by Lightweight::SqlNumeric< ThePrecision, TheScale >::operator=(), and Lightweight::SqlNumeric< ThePrecision, TheScale >::SqlNumeric().
|
inlineconstexprnoexcept |
Assigns a floating point value to the numeric.
Definition at line 99 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::assign().
|
inlineconstexprnoexcept |
Converts the numeric to an unscaled integer value.
Definition at line 106 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::Scale.
Referenced by Lightweight::SqlNumeric< ThePrecision, TheScale >::ToDouble(), Lightweight::SqlNumeric< ThePrecision, TheScale >::ToFloat(), and Lightweight::SqlNumeric< ThePrecision, TheScale >::ToLongDouble().
|
inlineconstexprnoexcept |
Converts the numeric to a floating point value.
Definition at line 127 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::ToUnscaledValue().
Referenced by Lightweight::SqlNumeric< ThePrecision, TheScale >::operator float().
|
inlineconstexprnoexcept |
Converts the numeric to a double precision floating point value.
Definition at line 133 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::ToUnscaledValue().
Referenced by Lightweight::SqlNumeric< ThePrecision, TheScale >::operator double().
|
inlineconstexprnoexcept |
Converts the numeric to a long double precision floating point value.
Definition at line 139 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::ToUnscaledValue().
Referenced by Lightweight::SqlNumeric< ThePrecision, TheScale >::operator long double(), and Lightweight::SqlNumeric< ThePrecision, TheScale >::ToString().
|
inlineexplicitconstexprnoexcept |
Converts the numeric to a floating point value.
Definition at line 145 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::ToFloat().
|
inlineexplicitconstexprnoexcept |
Converts the numeric to a double precision floating point value.
Definition at line 151 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::ToDouble().
|
inlineexplicitconstexprnoexcept |
Converts the numeric to a long double precision floating point value.
Definition at line 157 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::ToLongDouble().
|
inline |
Converts the numeric to a string.
Definition at line 163 of file SqlNumeric.hpp.
References Lightweight::SqlNumeric< ThePrecision, TheScale >::Scale, and Lightweight::SqlNumeric< ThePrecision, TheScale >::ToLongDouble().
|
inlineconstexprnoexcept |
Definition at line 168 of file SqlNumeric.hpp.
|
inlineconstexprnoexcept |
Definition at line 174 of file SqlNumeric.hpp.
|
staticconstexpr |
Number of total digits.
Definition at line 41 of file SqlNumeric.hpp.
Referenced by Lightweight::SqlNumeric< ThePrecision, TheScale >::assign().
|
staticconstexpr |
Number of digits after the decimal point.
Definition at line 44 of file SqlNumeric.hpp.
Referenced by Lightweight::SqlNumeric< ThePrecision, TheScale >::assign(), Lightweight::SqlNumeric< ThePrecision, TheScale >::ToString(), and Lightweight::SqlNumeric< ThePrecision, TheScale >::ToUnscaledValue().
|
staticconstexpr |
Definition at line 46 of file SqlNumeric.hpp.
| SQL_NUMERIC_STRUCT Lightweight::SqlNumeric< ThePrecision, TheScale >::sqlValue {} |
Definition at line 51 of file SqlNumeric.hpp.
| double Lightweight::SqlNumeric< ThePrecision, TheScale >::nativeValue {} |
Definition at line 54 of file SqlNumeric.hpp.