SaturnRingLibrary 0.9.1
SGL wrapper
 
Loading...
Searching...
No Matches

◆ As() [2/2]

template<typename T>
requires std::floating_point<T>
T SRL::Math::Types::Fxp::As ( ) const
inlineconstexpr

Converts to the specified floating-point type.

Template Parameters
TThe target floating-point type (float or double)
Returns
Value as the specified type

Example:

Fxp x = 3.14_fxp;
auto f = x.As<float>(); // Convert to float (heavy operation)
auto d = x.As<double>(); // Convert to double (heavy operation)
constexpr T As() const
Converts to the specified integer type.
Definition fxp.hpp:441
Note
The performance warning can be disabled by defining DISABLE_PERFORMANCE_WARNINGS before including this header. This is useful for code sections where you have already considered and accepted the performance implications.
Warning
Converting to floating-point is a heavy operation. Avoid in performance-critical code paths.