|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Strong type for a decimal-precision count. More...
#include <rational.hpp>
Public Member Functions | |
| constexpr | DecimalPlaces (std::uint32_t raw) noexcept |
| Explicit so a bare integer never silently becomes a precision. | |
| constexpr auto | operator<=> (const DecimalPlaces &other) const noexcept=default |
| Value ordering/equality on the raw digit count. | |
Public Attributes | |
| std::uint32_t | value {} |
| Raw digit count. Rational's invariant keeps it in [0, kMaxDecimalPlaces]. | |
Strong type for a decimal-precision count.
Prevents the precision from being confused with a numerator or a denominator at a call site: Rational{1, 3, DecimalPlaces{9}}.
Definition at line 121 of file rational.hpp.
|
inlineexplicitconstexprnoexcept |
Explicit so a bare integer never silently becomes a precision.
| raw | The digit count to box. |
Definition at line 129 of file rational.hpp.
|
nodiscardconstexprdefaultnoexcept |
Value ordering/equality on the raw digit count.
| other | Precision to compare against. |
| std::uint32_t morph::math::DecimalPlaces::value {} |
Raw digit count. Rational's invariant keeps it in [0, kMaxDecimalPlaces].
Definition at line 123 of file rational.hpp.